package com.sinog.front.controller.biz.mav;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.sinog.core.domain.AzbjRsVo;
import com.sinog.core.domain.ChangeTable;
import com.sinog.core.domain.PrisonerCjpg;
import com.sinog.core.domain.PrisonerFx;
import com.sinog.core.domain.PrisonerMain;
import com.sinog.core.model.PrisonerMainAndHcVo;
import com.sinog.core.model.UploadAppendixFile;
import com.sinog.core.model.UserDTO;
import com.sinog.core.util.CollectionUtils;
import com.sinog.core.util.ConvertHttpToMap;
import com.sinog.core.util.DateUtil;
import com.sinog.core.util.JsonUtil;
import com.sinog.core.util.PhoneUtil;
import com.sinog.core.util.StrUtil;
import com.sinog.core.utilbean.Avatar;
import com.sinog.core.utilbean.Constants;
import com.sinog.core.utilbean.IdGen;
import com.sinog.core.utilbean.Result;
import com.sinog.front.config.sso.SsoConfig;
import com.sinog.front.feign.basic.DepartmentService;
import com.sinog.front.feign.basic.MenuService;
import com.sinog.front.feign.basic.UserService;
import com.sinog.front.feign.biz.AdvanSearchService;
import com.sinog.front.feign.biz.AzgzInfoService;
import com.sinog.front.feign.biz.BaseInfoService;
import com.sinog.front.feign.biz.BaseInfoblService;
import com.sinog.front.feign.biz.BjdxFxInfoService;
import com.sinog.front.feign.biz.BjdxInfoService;
import com.sinog.front.feign.biz.BjdxMvInfoService;
import com.sinog.front.feign.biz.BjdxTuoguanInfoService;
import com.sinog.front.feign.biz.BjgzInfoService;
import com.sinog.front.feign.biz.ChangeTableService;
import com.sinog.front.feign.biz.DadcInfoService;
import com.sinog.front.feign.biz.HomeStatisticalService;
import com.sinog.front.feign.biz.IdGenService;
import com.sinog.front.feign.biz.MaintenanceService;
import com.sinog.front.feign.biz.PrisonerTransferService;
import com.sinog.front.feign.biz.PrisonerTsService;
import com.sinog.front.feign.biz.PrisonerVisitService;
import com.sinog.front.feign.biz.PrisonerXjxxService;
import com.sinog.front.feign.biz.ReleaseHelpEduService;
import com.sinog.front.feign.biz.SecXxxjService;
import com.sinog.front.feign.biz.SentenceService;
import com.sinog.front.feign.biz.SocialRelationsService;
import com.sinog.front.feign.biz.UploadFileTemplateService;
import com.sinog.front.feign.biz.VerificationService;
import com.sinog.front.feign.biz.WorkCoordinationService;
import com.sinog.front.feign.biz.XttzService;
import com.sinog.front.feign.biz.XxblService;
import com.sinog.front.feign.biz.census.AllCensusService;
import com.sinog.front.feign.biz.common.CommonService;
import com.sinog.front.feign.biz.xml.InterfaceDockingService;
import com.sinog.front.service.azbj.uploadappendix.UploadAppendixFileService;
import com.sinog.front.service.user.UserFacade;
import com.sinog.front.util.CodeUrlUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @desc 通用的ModelAndView跳转控制器
 * @author lzq
 * @date 2022/4/11 14:50
 */
@Slf4j
@RestController
public class ModelAndViewController {

    @Resource
    private UserFacade userService;
    @Resource
    private SentenceService sentenceService;
    @Resource
    private XxblService xxblService;
    @Resource
    private SocialRelationsService socialRelationsService;
    @Resource
    private BaseInfoService baseInfoService;
    @Resource
    private SecXxxjService secXxxjService;
    @Resource
    private MenuService menuservice;
    @Resource
    private BaseInfoblService baseInfoblService;
    @Resource
    private DadcInfoService dadcInfoService;
    @Resource
    private BjdxMvInfoService bjdxMvInfoService;
    @Resource
    private BjdxInfoService bjdxInfoService;
    @Resource
    private IdGenService idGenService;
    @Resource
    private BjgzInfoService bjgzInfoService;
    @Resource
    private AzgzInfoService azgzInfoService;
    @Resource
    private PrisonerVisitService prisonerVisitService;
    @Resource
    private ReleaseHelpEduService releaseHelpEduService;
    @Resource
    private AdvanSearchService advanSearchService;
    @Resource
    private UploadFileTemplateService uploadFileTemplateService;
    @Resource
    private VerificationService verificationService;
    @Resource
    private WorkCoordinationService workCoordinationService;
    @Resource
    private UserService userServiceOne;
    @Resource
    private HomeStatisticalService homeStatisticalService;
    @Autowired
    private AllCensusService allCensusService;
    @Resource
    private XttzService xttzService;
    @Resource
    private MaintenanceService maintenanceService;
    /**
     * 注入查询总条数的实现类
     */
    @Resource
    private UploadAppendixFileService uploadAppendixService;
    @Resource
    private BjdxTuoguanInfoService bjdxTuoguannfoService;
    @Resource
    private PrisonerTransferService prisonerTransferService;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @Resource
    private CommonService commonService;
    @Resource
    private BjdxFxInfoService bjdxFxInfoService;
    @Resource
    private InterfaceDockingService interfaceDockingService;
    @Resource
    private PrisonerXjxxService prisonerXjxxService;
    @Resource
    private PrisonerTsService prisonerTsService;
    @Resource
    private ChangeTableService changeTableService;
    @Resource
    private DepartmentService departmentService;
    @Resource
    private SsoConfig ssoConfig;
    @Value("${gkzx.azbj.security.open_qz_change_password}")
    private String qzChangePassword;
    /**
     * 是否支持异地登录  true 不支持  false  支持
     */
    @Value("${gkzx.azbj.login.use.state}")
    private Boolean remoteLoginState;
    @Value("${gkzx.azbj.security.user_default_password}")
    private String mima;
    // ----------------------------------- todo: OrgStaffInfoController -----------------------------------

    /**
     * 安帮工作资源管理 - 机构人员信息管理 - 机构人员信息管理 - 跳转机构人员信息编辑页面
     * @param flog 0：页面可以编辑 1：页面不可以编辑
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jgryxx/orgStaffInfo/edit/{flog}")
    public ModelAndView toOrgStaffInfoEdit(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/gzzygl/orgStaffInfo_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clabName",userDTO.getDepartName());
            modelAndView.addObject("adduserid",userDTO.getDepartid());
            modelAndView.addObject("addUserName",userDTO.getDepartName());
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: AbryXjController -----------------------------------

    /**
     * 信息补录tabs页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/tabs")
    public ModelAndView xxblTabs(HttpServletRequest request) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/xxbl-tabs");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            String priNum = (String)params.get("priNum");
            //上一次的刑期止日
            String pristopold2 = (String)params.get("pristopold");
            modelAndView.addObject("priNum",priNum);
            //将上一次的刑期止日放入到页面中回显
            modelAndView.addObject("pristopold",pristopold2);
            // 山西个性化需求,获取当前的localCode存储与页面
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 描述
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/tabsEdit")
    public ModelAndView xxblTabstabsEdit(HttpServletRequest request) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/xxbl-tabsEdit");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            String priNum = (String)params.get("priNum");
            //上一次的刑期止日
            String pristopold2 = (String)params.get("pristopold");
            modelAndView.addObject("priNum",priNum);
            //将上一次的刑期止日放入到页面中回显
            modelAndView.addObject("pristopold",pristopold2);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 减刑假释tab页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/jxjs/tab")
    public ModelAndView toJxjsTab(HttpServletRequest request) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/jxjs-tab");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            UserDTO userDTO = userService.getAuthentication();
            String priNum = (String)params.get("priNum");
            Integer isAll = sentenceService.getIsAll(priNum);
            boolean flag = (null == isAll || Constants.Number.NUM_ZERO >= isAll) && (priNum.contains(Constants.OldDataFlag.A_FLAG) || priNum.contains(Constants.OldDataFlag.B_FLAG));
            if(flag) {
                return new ModelAndView("/error/polise_hc");
            }
            //主要是查询jxjs表中刑期止日pri_stop字段
            PrisonerFx prisonerfx = xxblService.selectJxjsPriStopInfo(priNum);
            String pristopold1 = "";
            Date priStopOld = prisonerfx.getPriStop();
            //创建SimpleDateFormat对象实例并定义好转换格式
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            //处理死缓无期的逻辑判断
            if(null != priStopOld) {
                //上一次的刑期止日
                pristopold1 = sdf.format(priStopOld);
            }
            mav.addObject("priNum",priNum);
            //将刑期止日回显到页面的隐藏域中
            mav.addObject("pristopold",pristopold1);
            mav.addObject("account",userDTO.getAccount());
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 减刑假释信息录入页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/jxjs/add")
    public ModelAndView addJxjsPage(HttpServletRequest request) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                mav = new ModelAndView("azbj/yazgl/jxjs-add-sx");
            } else {
                mav = new ModelAndView("azbj/yazgl/jxjs-add");
            }
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            String priNum = (String)params.get("priNum");
            String pristopold3 = "";
            String pribegin = "";
            //从prisoner_fx表获取罪犯刑期止日与刑期类型
            Result result = xxblService.getPrisonerFxInfo(priNum);
            if(!StringUtils.equals(result.getData().toString(),"")) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                //刑期启日
                pribegin = ((String)data.get("priBegin")).substring(0, 10);
                //刑期类型
                String pritime = data.get("pritime").toString();
                String priStop = (String)data.get("priStop");
                if(StringUtils.isEmpty(priStop)) {
                    if(Constants.PritimeType.PRITIME_SXHE.equals(pritime)) {
                        pristopold3 = "死刑，缓期二年执行";
                    } else if(Constants.PritimeType.PRITIME_WQ.equals(pritime)) {
                        pristopold3 = "无期徒刑";
                    } else {
                        //刑期止日
                        pristopold3 = (String)params.get("pristopold");
                    }
                } else {
                    //刑期止日
                    pristopold3 = (String)params.get("pristopold");
                }
            }
            mav.addObject("pribegin",pribegin);
            mav.addObject("priNum",priNum);
            //将最新的刑期止日回显到页面
            mav.addObject("pristopold",pristopold3);
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 补录页面,待衔接页面,衔接中页面,已衔接页面,衔接失败页面公共列表
     * @param request request
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/resettlemanage/xjxx/view")
    public ModelAndView toXjxxPublicListPag(HttpServletRequest request,@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView = new ModelAndView("/azbj/yazgl/list-xxbl");
            //获取用户信息
            UserDTO userDTO = userService.getAuthentication();
            //用户资源权限
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            modelAndView.addObject("sxjybl","false");
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
                int lengthTD=1575;
                if(id.toString().equals(Constants.ResourceId.BATCH_IMPORT_ZJRY) || id.toString().equals(Constants.ResourceId.KSS_XXLR)){
                    lengthTD=1400;
                }
                boolean isWrap = rightFix(data,lengthTD,1.2);
                modelAndView.addObject("isWrap",isWrap);
                if(id.toString().equals(Constants.ResourceId.BATCH_IMPORT_XXBL)){
                    modelAndView.addObject("bl",true);
                }else{
                    modelAndView.addObject("bl",false);
                }
                modelAndView.addObject("level",userDTO.getLevel());
                //是否是待衔接
                if(id.toString().equals(Constants.ResourceId.RIGHT_Xj) && null==state){
                    modelAndView.addObject("xj",true);
                }else{
                    modelAndView.addObject("xj",false);
                }
                boolean flag = id.toString().equals(Constants.ResourceId.BATCH_IMPORT_YAZLR)
                        || id.toString().equals(Constants.ResourceId.BATCH_IMPORT_SJLR)
                        || (id.toString().equals(Constants.ResourceId.BATCH_IMPORT_XXBL) && userDTO.getLevel().equals(Constants.OrgLevel.LEVEL_SFS));
                if(flag) {
                    modelAndView.addObject("showCheckColumn",true);
                }
                // 山西个性化需求:出监评估页面高亮显示
                if(id.toString().equals(Constants.ResourceId.JY_XXBL)){
                    modelAndView.addObject("sxjybl","true");
                }
            }
            modelAndView.addObject("localCode",localCode);
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }

    /**
     * 职业技能tab页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/zyjn/tab")
    public ModelAndView toZyjnTab(HttpServletRequest request) {
        //职业技能tab页面
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/zyjn-tab");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            //服刑人员编号
            String priNum = (String)params.get("priNum");
            mav.addObject("priNum",priNum);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 职业技能添加页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/zyjn/add")
    public ModelAndView addZyjnPage(HttpServletRequest request) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/zyjn-page");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            String priNum = (String)params.get("priNum");
            mav.addObject("priNum",priNum);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 职业技能信息列表
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/zyjn/edit")
    public ModelAndView zyjnInfoEdit(HttpServletRequest request) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/zyjn-page");
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            String id = (String)params.get("id");
            String data = xxblService.selectZyjnById(id);
            Map<String,Object> map = JsonUtil.toMap(data);
            mav.addObject("id",id);
            mav.addObject("zyjn",map.get("zyjn"));
            mav.addObject("certName",map.get("certName"));
            mav.addObject("type",map.get("type"));
            mav.addObject("isAccept",map.get("isAccept"));
            mav.addObject("priNum",map.get("priNum"));
            mav.addObject("parentZyjn",map.get("parentZyjn"));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 危险性评估tab页面
     * @param request request
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/wxxpg/tab")
    public ModelAndView toWxxpgTab(HttpServletRequest request,
                                   @RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            // 山西个性化危险性评估页面
            // 获取当前登录省份的code
            String localCode = CodeUrlUtils.getLocalCode();
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                mav = new ModelAndView("/azbj/yazgl/wxxpg-tab-sx");
            } else {
                mav = new ModelAndView("/azbj/yazgl/wxxpg-tab");
            }
            //查询上传附件的数量
            Result result1 = uploadAppendixService.getCountAll(prinum,Constants.AppendixFile.APDIX_FILE_FOUR);
            Result result2 = uploadAppendixService.getCountAll(prinum,Constants.AppendixFile.APDIX_FILE_FIVE);
            Result result3 = uploadAppendixService.getCountAll(prinum,Constants.AppendixFile.APDIX_FILE_ONE);
            //查询该罪犯出监评估信息
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum(prinum);
            Map<String,Object> cjpgInfoMap = JsonUtil.toMap(cjpgInfo);
            //危险性评估信息
            String map = sentenceService.getSenInfoById(prinum);
            Integer isAll = sentenceService.getIsAll(prinum);
            boolean flag = (null == isAll || Constants.Number.NUM_ZERO >= isAll) && (prinum.contains(Constants.OldDataFlag.A_FLAG) || prinum.contains(Constants.OldDataFlag.B_FLAG));
            if(!flag) {
                Map<String,Object> jsonMap = JsonUtil.toMap(map);
                mav.addObject("count1",result1.getData());
                mav.addObject("count2",result2.getData());
                mav.addObject("count3",result3.getData());
                mav.addObject("priNum",prinum);
                mav.addObject("id",ObjectUtils.isEmpty(jsonMap.get("id")) ? null : jsonMap.get("id"));
                mav.addObject("amnesty",ObjectUtils.isEmpty(jsonMap.get("amnesty")) ? null : jsonMap.get("amnesty"));
                mav.addObject("zfz","".equals(jsonMap.get("zfz")) ? null : jsonMap.get("zfz"));
                mav.addObject("death","".equals(jsonMap.get("death")) ? null : jsonMap.get("death"));
                mav.addObject("zrsqjz","".equals(jsonMap.get("zrsqjz")) ? null : jsonMap.get("zrsqjz"));
                mav.addObject("sanwu",jsonMap.get("sanwu"));
                mav.addObject("sanjia",jsonMap.get("sanjia"));
                mav.addObject("wujia",jsonMap.get("wujia"));
                mav.addObject("wuqin",jsonMap.get("wuqin"));
                mav.addObject("wuye",jsonMap.get("wuye"));
                mav.addObject("jxm",jsonMap.get("jxm"));
                mav.addObject("jsf",jsonMap.get("jsf"));
                mav.addObject("jhj",jsonMap.get("jhj"));
                mav.addObject("wushe",jsonMap.get("wushe"));
                mav.addObject("sishi",jsonMap.get("sishi"));
                mav.addObject("shekong",jsonMap.get("shekong"));
                mav.addObject("shexie",jsonMap.get("shexie"));
                mav.addObject("shedu",jsonMap.get("shedu"));
                mav.addObject("sheqiang",jsonMap.get("sheqiang"));
                mav.addObject("shehei",jsonMap.get("shehei"));
                mav.addObject("xijing",jsonMap.get("xijing"));
                mav.addObject("taotuo",jsonMap.get("taotuo"));
                mav.addObject("drughis",jsonMap.get("drughis"));
                mav.addObject("zisha",jsonMap.get("zisha"));
                mav.addObject("gaizao",jsonMap.get("gaizao"));
                mav.addObject("renzui",jsonMap.get("renzui"));
                mav.addObject("xinli",jsonMap.get("xinli"));
                mav.addObject("lianxi",jsonMap.get("lianxi"));
                mav.addObject("baowaijiuyi","".equals(jsonMap.get("baowaijiuyi")) ? null : jsonMap.get("baowaijiuyi"));
                mav.addObject("pinggu",jsonMap.get("pinggu"));
                mav.addObject("weifa",jsonMap.get("weifa"));
                mav.addObject("canji",jsonMap.get("canji"));
                mav.addObject("Aftype",jsonMap.get("Aftype"));
                mav.addObject("xianxingqizhiri",jsonMap.get("xianxingqizhiri"));
                // 打开页面回显吸毒信息
                if(ObjectUtils.isEmpty(cjpgInfoMap)) {
                    mav.addObject("xd",Constants.NumberStr.NUM_STR_TWO);
                } else {
                    mav.addObject("xd",cjpgInfoMap.get("xd"));
                }
                if(null != cjpgInfoMap) {
                    mav.addObject("canji",cjpgInfoMap.get("canji"));
                    mav.addObject("gdzs",cjpgInfoMap.get("gdzs"));
                    mav.addObject("shjw",cjpgInfoMap.get("shjw"));
                    mav.addObject("jtbh",cjpgInfoMap.get("jtbh"));
                    mav.addObject("baowaijiuyi",cjpgInfoMap.get("baowaijiuyi"));
                    mav.addObject("xshkn",cjpgInfoMap.get("xshkn"));
                    mav.addObject("jiuzhujianyi",cjpgInfoMap.get("jiuzhujianyi"));
                }
                return mav;
            } else {
                return new ModelAndView("/error/polise_hc");
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 待衔接页面tabs页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/dxj/tabs")
    public ModelAndView dXjTabs(HttpServletRequest request) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/dxj-tabs");
            //将request转换为map的形式
            Map<String,Object> map = ConvertHttpToMap.getParameterMap(request);
            //查询该罪犯是否录入出监评估
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum((String)map.get("priNum"));
            if(null != cjpgInfo && !cjpgInfo.isEmpty()) {
                //flag标志为1：已经录入出监评估，标志为0：未录入出监评估
                modelAndView.addObject("flag",1);
            } else {
                //flag标志为1：已经录入出监评估，标志为0：未录入出监评估
                modelAndView.addObject("flag",0);
            }
            //罪犯编号
            modelAndView.addObject("priNum",map.get("priNum"));
            //危险性评估结果
            modelAndView.addObject("pinggu",map.get("pinggu"));
            //服刑人员姓名
            modelAndView.addObject("pName",map.get("pName"));
            //唯一标识id
            modelAndView.addObject("id",map.get("id"));
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 衔接页面
     * 向页面中传输生成id与罪犯编号
     * 用于保存xjxx与上传附件信息
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/xj")
    public ModelAndView addOrEidtXj(HttpServletRequest request) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/xj-add");
            //将request转换为map的形式
            Map<String,Object> map = ConvertHttpToMap.getParameterMap(request);
            modelAndView.addObject("id",map.get("id"));
            UserDTO authentication = userService.getAuthentication();
            //查询上传的文件数量
            Result result1 = uploadAppendixService.getCountAll(map.get("priNum").toString(),Constants.NumberStr.NUM_STR_TEN_TWO);
            //查询该罪犯是否录入出监评估
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum((String)map.get("priNum"));
            Map<String,String> prisonerFxMaps = baseInfoService.getSwSjInfo((String)map.get("priNum"));
            modelAndView.addObject("level",authentication.getLevel());
            modelAndView.addObject("count1",result1.getData());
            modelAndView.addObject("startCheckPersion",authentication.getUsername());
            modelAndView.addObject("phone",authentication.getPhone());
            modelAndView.addObject("tel",authentication.getTelphone());
            modelAndView.addObject("wushe",prisonerFxMaps.get("wushe"));
            modelAndView.addObject("shehei",prisonerFxMaps.get("shehei"));
            modelAndView.addObject("shekong",prisonerFxMaps.get("shekong"));
            modelAndView.addObject("Aftype",prisonerFxMaps.get("aftype"));
            modelAndView.addObject("weifa",prisonerFxMaps.get("weifa"));
            modelAndView.addObject("SANJIA",prisonerFxMaps.get("sanjia"));
            modelAndView.addObject("Sanwu",prisonerFxMaps.get("sanwu"));
            //通过罪犯编号查询是否是人员自返
            modelAndView.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum((String)map.get("priNum")));
            if(null != cjpgInfo && !cjpgInfo.isEmpty()) {
                //罪犯编号
                modelAndView.addObject("priNum",map.get("priNum"));
                modelAndView.addObject("pinggu",map.get("pinggu"));
                modelAndView.addObject("pName",map.get("pName"));
                //flag标志为1：已经录入出监评估，标志为0：未录入出监评估
                modelAndView.addObject("flag",Constants.Number.NUM_ONE);
            } else {
                //罪犯编号
                modelAndView.addObject("priNum",map.get("priNum"));
                modelAndView.addObject("pinggu",map.get("pinggu"));
                modelAndView.addObject("pName",map.get("pName"));
                //flag标志为1：已经录入出监评估，标志为0：未录入出监评估
                modelAndView.addObject("flag",Constants.Number.NUM_ZERO);
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 衔接-回执页面-监狱
     * 向页面中传输生成id与罪犯编号
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xj/hz")
    public ModelAndView addXjHz(@RequestParam String priNum) {
        ModelAndView modelAndView;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView = new ModelAndView("/azbj/yazgl/xj-hz");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("sender",userDTO.getUsername());
            modelAndView.addObject("username",userDTO.getUsername());
            modelAndView.addObject("phone",userDTO.getPhone());
            modelAndView.addObject("tel",userDTO.getTelphone());
            modelAndView.addObject("priNum",priNum);
            modelAndView.addObject("level",userDTO.getLevel());
            //通过罪犯编号查询是否是监狱送回
            modelAndView.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 衔接-回执页面-司法所
     * 向页面中传输生成id与罪犯编号
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xj/hzsfs")
    public ModelAndView addXjHzsfs(String priNum) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/xj-hz-sfs");
            //山西个性化需求:监狱、回执、备注分必填
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView.addObject("localCode",localCode);
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("priNum",priNum);
            modelAndView.addObject("startCheckPerson", userDTO.getDepartName());
            modelAndView.addObject("startCheckPhone",userDTO.getPhone());
            modelAndView.addObject("level",userDTO.getLevel());
            //通过罪犯编号查询是否是监狱送回
            modelAndView.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 预安置管理 - 预释放人员衔接 - 查看 - 档案材料
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xj/dangan")
    public ModelAndView addXjDangAn(String priNum) {
        ModelAndView modelAndView;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView = new ModelAndView("/azbj/yazgl/xj-dangan");
            Map<String,Object> paramMap = new HashMap<>(16);
            //通过罪犯编号查询衔接信息表是否存在，如不存在，则为未衔接数据 flag=1
            int flag = Constants.Number.NUM_ZERO;
            String xjxxIdByPriNum = secXxxjService.getXjxxIdByPriNum(priNum);
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(priNum);
            if(StringUtils.isBlank(xjxxIdByPriNum)) {
                flag = Constants.Number.NUM_ONE;
            }
            if(null != prisonerMain) {
                modelAndView.addObject("pname",prisonerMain.getPName());
                modelAndView.addObject("idnum",prisonerMain.getIdNum());
                modelAndView.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            }
            paramMap.put("flag",flag);
            paramMap.put("priNum",priNum);
            //查询档案数据
            String obj = baseInfoService.xjxxJsonData(paramMap);
            String stateXj = prisonerMain.getStateXj();
            modelAndView.addObject("stateXj",stateXj);
            modelAndView.addObject("priNum",priNum);
            modelAndView.addObject("obj",JsonUtil.toMap(obj));
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 衔接-完成衔接页面
     * @param priNum priNum
     * @param secstatexj secstatexj
     * @param id id
     * @param pdanwei pdanwei
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xj/completely")
    public ModelAndView addCompletelyPage(
            @RequestParam(defaultValue = "-1", required = false) String priNum,
            @RequestParam(defaultValue = "-1", required = false) String secstatexj,
            @RequestParam(defaultValue = "-1", required = false) String id,
            @RequestParam(defaultValue = "-1",required = false) String pdanwei) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/xj-completely");
            modelAndView.addObject("priNum",priNum);
            modelAndView.addObject("secstatexj",secstatexj);
            modelAndView.addObject("id",id);
            String level;
            // 山西新需求,衔接释放途径
            if(Constants.Number.NUM_FOUR.equals(pdanwei.length())) {
                level = Constants.NumberStr.NUM_STR_ZERO_ONE;
            } else if(Constants.Number.NUM_FIVE.equals(pdanwei.length())) {
                level = Constants.NumberStr.NUM_STR_ZERO_TWO;
            } else if(Constants.Number.NUM_TEN.equals(pdanwei.length())) {
                level = Constants.NumberStr.NUM_STR_ZERO_FIVE;
            } else {
                level = "";
            }
            modelAndView.addObject("level",level);
            // 点击完成衔接 - 查询上传凭证证据 10
            Result result = uploadAppendixService.getCountAll(priNum,Constants.AppendixFile.APDIX_FILE_TEN);
            // 查询公安机关附件数量 11
            Result result1 = uploadAppendixService.getCountAll(priNum,Constants.AppendixFile.APDIX_FILE_TEN_ONE);
            modelAndView.addObject("count1",result1.getData());
            modelAndView.addObject("count",result.getData());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 预安置信息查看--查看
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseInfo/hjqc/toViewTabs/view")
    public ModelAndView toViewTabs(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/yazgl/yazHjqyViewTabs");
            mv.addObject("priNum",priNum);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 预安置管理查看 - 基本信息 - 查看
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseInfo/toViewTabs/view/baseInfoTab")
    public ModelAndView toBaseInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxJbxxViewTab");
            mv.addObject("priNum",priNum);
            Result result = baseInfoService.getBaseInfoViewByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mv.addAllObjects(map);
            }
            // 山西个性化需求: 居住地改为日常居住地
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mv.addObject("localCode",localCode);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转 二次衔接上报新增
     * @param priNum priNum
     * @param secondstate secondstate
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ysfryxj/xjsb/report")
    public ModelAndView toReportAdd(
            @RequestParam(defaultValue = "-1", required = false) String priNum,
            @RequestParam(defaultValue = "-1", required = false) String secondstate) {
        ModelAndView mav = null;
        try {
            UserDTO user = userService.getAuthentication();
            String localProvinceCode = user.getDepartid().substring(0,2) + "0000";
            String localProvinceName = commonService.getCodeNameByCode(localProvinceCode);
            String interProBusiness = secXxxjService.getInterProvincialBusinessInfo(priNum);
            String level = prisonerXjxxService.selectPdanweiLevelByPriNum(priNum);
            if(null == level) {
                level = Constants.OrgLevel.LEVEL_JY;
            }
            String xjxxId = secXxxjService.getXjxxIdByPriNum(priNum);
            // 查询公安机关附件数量
            Result result1 = uploadAppendixService.getCountAll(priNum,"35");
            Map<String,Object> resultMap = JsonUtil.toMap(interProBusiness);
            //如果是社矫管理局，监狱局，监管总队，会出现空指针
            //如果监狱发起
            if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_JY)) {
                mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add");
                mav.addObject("jylxr",user.getUsername());
                mav.addObject("jyphone",user.getPhone());
                mav.addObject("jytel",user.getTelphone());
                mav.addObject("level",user.getLevel());
            } else if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_SFT)) {
                // 司法厅
                mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add");
                mav.addObject("jyphone",user.getPhone());
                mav.addObject("sftlxr",user.getUsername());
                mav.addObject("jytel",user.getTelphone());
            } else if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_SJZX)) {
                //社矫中心
                mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add_sj");
                mav.addObject("jylxr",user.getUsername());
                mav.addObject("jyphone",user.getPhone());
                mav.addObject("jytel",user.getTelphone());
            } else if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_KSS)) {
                //看守所
                mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add_kss");
                mav.addObject("jylxr",user.getUsername());
                mav.addObject("jyphone",user.getPhone());
                mav.addObject("jytel",user.getTelphone());
            }
            if(null != resultMap) {
                if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_JYJ)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add");
                } else if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_SSJ)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add_sj");
                } else if(StringUtils.equals(user.getLevel(),Constants.OrgLevel.LEVEL_JGZONGD)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_add_kss");
                }
                //监狱局二次衔接上报
                mav.addObject("id",resultMap.get("id"));
                mav.addObject("jyyj",resultMap.get("jyyj"));
                mav.addObject("jyjyj",resultMap.get("jyjyj"));
                mav.addObject("jylxr",resultMap.get("jylxr"));
                mav.addObject("jyphone",resultMap.get("jyphone"));
                mav.addObject("jytel",resultMap.get("jytel"));
                mav.addObject("sftphone",resultMap.get("sftphone"));
                mav.addObject("sftlxr",resultMap.get("sftlxr"));
                mav.addObject("sfttel",resultMap.get("sfttel"));
                mav.addObject("sftyj",resultMap.get("sftyj"));
                mav.addObject("provinceCode",localProvinceCode);
                mav.addObject("provinceName",localProvinceName);

            }
            mav.addObject("priNum",priNum);
            mav.addObject("level",user.getLevel());
            mav.addObject("pdanweiLevel",level);
            mav.addObject("xjxxId",xjxxId);
            mav.addObject("secondstate",secondstate);
            // 添加文件数量
            mav.addObject("count1",result1.getData());
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 二次衔接上报信息查看
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ysfryxj/xjsb/report/view")
    public ModelAndView toReportView(@RequestParam(defaultValue = "-1", required = false) String priNum) {
        UserDTO user = userService.getAuthentication();
        ModelAndView mav;
        try {
            //查看按钮，因为服刑人员录入的单位不一样，会跳转到不同页面
            PrisonerMain prisonerMain = baseInfoService.selectPmById(priNum);
            String pdanwei = prisonerMain.getPdanweiName();
            if(!StringUtils.isEmpty(pdanwei)) {
                if(pdanwei.contains(Constants.DepartmentName.DEPARTMENT_JY)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_view");
                    mav.addObject("level",user.getLevel());
                } else if(pdanwei.contains(Constants.DepartmentName.DEPARTMENT_SJ)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_view_sj");
                } else if(pdanwei.contains(Constants.DepartmentName.DEPARTMENT_KSS)) {
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_view_kss");
                } else {
                    //因为老数据好多的服刑单位匹配不上,为了防止报错,这块让它走默认的监狱页面
                    mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_view");
                }
            } else {
                //因为老数据好多的服刑单位为空,为了防止报错,这块让它走默认的监狱页面
                mav = new ModelAndView("/azbj/yazgl/secxj/xjsb_view");
            }
            String result = secXxxjService.getReportInfo(priNum);
            String xjxxId = secXxxjService.getXjxxIdByPriNum(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(result);
            if(null != resultMap) {
                mav.addObject("id",resultMap.get("id"));
                mav.addObject("jylxr",resultMap.get("jylxr"));
                mav.addObject("jyphone",resultMap.get("jyphone"));
                mav.addObject("jytel",resultMap.get("jytel"));
                mav.addObject("jyyj",resultMap.get("jyyj"));
                mav.addObject("jyjyj",resultMap.get("jyjyj"));
                mav.addObject("sftphone",resultMap.get("sftphone"));
                mav.addObject("sftlxr",resultMap.get("sftlxr"));
                mav.addObject("sfttel",resultMap.get("sfttel"));
                mav.addObject("sftyj",resultMap.get("sftyj"));
                mav.addObject("secondprovince",resultMap.get("secondprovince"));
                mav.addObject("secondcity",resultMap.get("secondcity"));
                mav.addObject("secondcounty",resultMap.get("secondcounty"));
                mav.addObject("secondstreet",resultMap.get("secondstreet"));
                mav.addObject("secondstate",resultMap.get("secondstate"));
            }
            mav.addObject("priNum",priNum);
            mav.addObject("level",user.getLevel());
            mav.addObject("xjxxId",xjxxId);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 重新发起衔接
     * @param priNum priNum
     * @param secondstate secondstate
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ysfryxj/xjsb/againxj")
    public ModelAndView toAgainXjPage(
            @RequestParam(defaultValue = "-1", required = false) String priNum,
            @RequestParam(defaultValue = "-1", required = false) String secondstate) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/secxj/againxj");
            // 查询刑满释放人员通知书上传文件数量
            Result result1 = uploadAppendixService.getCountAll(priNum,Constants.NumberStr.NUM_STR_TEN_TWO);
            String result = secXxxjService.getAgainXjPageInfo(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(result);
            Map<String,String> prisonerFxMaps = baseInfoService.getSwSjInfo(priNum);
            mav.addObject("count1",result1.getData());
            mav.addObject("wushe",prisonerFxMaps.get("wushe"));
            mav.addObject("shehei",prisonerFxMaps.get("shehei"));
            mav.addObject("shekong",prisonerFxMaps.get("shekong"));
            mav.addObject("Aftype",prisonerFxMaps.get("aftype"));
            mav.addObject("weifa",prisonerFxMaps.get("weifa"));
            mav.addObject("SANJIA",prisonerFxMaps.get("sanjia"));
            mav.addObject("Sanwu",prisonerFxMaps.get("sanwu"));
            mav.addObject("type",resultMap.get("type"));
            mav.addObject("yiban",resultMap.get("yiban"));
            mav.addObject("zhongdian",resultMap.get("zhongdian"));
            mav.addObject("lianxiren",resultMap.get("lianxiren"));
            if(null != resultMap.get("dianhua")) {
                Map<String,String> telAndPhone = PhoneUtil.splitTelAndPhone((String)resultMap.get("dianhua"));
                mav.addObject("phone",telAndPhone.get(Constants.PhoneAndTel.PHONE));
                mav.addObject("tel",telAndPhone.get(Constants.PhoneAndTel.TEL));
            }
            //通过罪犯编号查询返回方式--监狱送回改为送回时间，送回地点/人员自返改为返回时间，返回地点/基层组织接回改为接回时间，接回地点
            mav.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            //机构级别--区分监狱/看守所/社矫  联系人和手机号码等需要做相应的变化
            mav.addObject("level",userService.getAuthentication().getLevel());
            mav.addObject("JHSJ",resultMap.get("jhsj"));
            mav.addObject("JHDD",resultMap.get("jhdd"));
            mav.addObject("Tujing",resultMap.get("tujing"));
            //罪犯编号
            mav.addObject("priNum",resultMap.get("priNum"));
            //危险性评估结果
            mav.addObject("pinggu",resultMap.get("pinggu"));
            //服刑人员姓名
            mav.addObject("pName",resultMap.get("pName"));
            //唯一标识id
            mav.addObject("id",resultMap.get("id"));
            mav.addObject("secondstate",resultMap.get("secondstate"));
            // 司法所信息
            mav.addObject("sfsinfo",resultMap.get("secondprovince") + "-" + resultMap.get("secondcity") + "-" + resultMap.get("secondcounty") + "-" + resultMap.get("secondstreet"));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: AzbjDatabaseInfoController -----------------------------------

    /**
     * 跳转新增页面
     * @param request request
     * @param ischeck ischeck
     * @return ModelAndView
     */
    @RequestMapping("/azbj/abzlxxgl/azbjDatabaseInfo/view")
    public ModelAndView toIndex1(HttpServletRequest request,@RequestParam(required = false, defaultValue = "-1") String ischeck) {
        ModelAndView modelAndView;
        try {
            if(Constants.NumberStr.NUM_STR_FU_ONE.equals(ischeck)) {
                modelAndView = new ModelAndView("azbj/abzlxxgl/azbjDatabaseInfo_edit");
            } else {
                modelAndView = new ModelAndView("azbj/abzlxxgl/azbjDatabaseInfo_see");
            }
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("adduserid",userDTO.getDepartName());
            modelAndView.addObject("updanwei",userDTO.getDepartid());
            modelAndView.addObject("userlevel",userDTO.getLevel());
            modelAndView.addObject("id",IdGen.strid());
            modelAndView.addObject("ischeck",ischeck);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转 安帮资料列表页面
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/azbj/abzlxxgl/public/listview")
    public ModelAndView toAbzlPublicListPage(@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/abzlxxgl/list_abzl");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
                modelAndView.addObject("createUser",userDTO.getAccount());
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: BackgroundController -----------------------------------

    /**
     * 跳转更改背景页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/background/change")
    public ModelAndView toChangeBackground() {
        return new ModelAndView("azbj/background/changeBackground");
    }
    // ----------------------------------- todo: BgscController -----------------------------------

    /**
     * 跳转报告生成页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/bgsc/view")
    public ModelAndView toIndex2(HttpServletRequest request) {
        return new ModelAndView("azbj/sjtjfx/bgsc/bgsc");
    }
    // ----------------------------------- todo: CommonController -----------------------------------

    /**
     * 跳转 预安置人员信息录入——添加
     * @return ModelAndView
     */
    @RequestMapping("/azbj/topopup")
    public ModelAndView toPopup() {
        return new ModelAndView("/azbj/yazgl/baseinfo_popup");
    }

    /**
     * 跳转 社矫人员信息录入——添加
     * @return ModelAndView
     */
    @RequestMapping("/azbj/tosjpopup")
    public ModelAndView tosjPopup() {
        return new ModelAndView("/azbj/yazgl/baseinfo_sj_popup");
    }

    /**
     * 监狱释放人员补录页面跳转
     * @return ModelAndView
     */
    @RequestMapping("/azbj/topopupBu")
    public ModelAndView topopupBu() {
        return new ModelAndView("/azbj/azbjgl/ryxxbl/baseinfo_popupbu");
    }

    /**
     * 跳转 预安置人员信息录入——添加
     * @return ModelAndView
     */
    @RequestMapping("/azbj/toimport")
    public ModelAndView toimport() {
        return new ModelAndView("/azbj/yazgl/baseinfo_import");
    }

    /**
     * 跳转基本信息编辑tab页
     * @param prinum prinum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/editview")
    public ModelAndView toEidtTabs(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_tabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转基本信息编辑tab页
     * @param prinum prinum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/editviewexcel")
    public ModelAndView toEidtTabsExcel(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_tabs_excel");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转社矫基本信息编辑tab页
     * @param prinum prinum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/sjeditview")
    public ModelAndView toSjEidtTabs(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_sj_tabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转到人员信息补录的页面
     * @param prinum prinum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/editBlview")
    public ModelAndView toBlEidtTabs(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            //判断是社矫录入还是监狱释放录入
            String type = baseInfoblService.findTuJing(prinum);
            if(Constants.NumberStr.NUM_STR_ZERO_TWO.equals(type)) {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_bljj_tabs");
            } else {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_bl_tabs");
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 描述
     * @param prinum prinum
     * @param id id
     * @param level level
     * @return ModelAndView
     */
    @RequestMapping("/azbj/success/baseinfo/editview")
    public ModelAndView toSuccessEidtTabs(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id,
            @RequestParam(required = false, defaultValue = "-1") String level) {
        ModelAndView mav;
        try {
            if(Constants.NumberStr.NUM_STR_ONE.equals(level)) {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_tabs").addObject("successFlag","1");
            } else {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_success_tabs").addObject("successFlag","1");
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转司法所核查中可编辑基本信息和社会关系的tab页面
     * @param prinum prinum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/tolookviewOrEdit")
    public ModelAndView tolookviewOrEdit(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_tabs_special");
            // 湖南看守所特殊编辑框
            Result hnInterfaceOpposite = interfaceDockingService.getHnInterfaceOppositeByPriNum(prinum);
            // 是否为看守所特殊编辑按钮
            if(Constants.Number.NUM_ZERO < (Integer)hnInterfaceOpposite.getData()) {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_tabs_special_hn");
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 核查中 - 湖南看守所对接信息 - 司法所编辑
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoeditSpecialHn/view")
    public ModelAndView toBaseinfoEditSpecialHn(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav = new ModelAndView("azbj/yazgl/inmates_edittabs_special_hn");
        mav.addObject("prinum",JsonUtil.toText(prinum));
        return mav;
    }

    /**
     * 预安置管理 - 预安置人员核查 — 查看
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/tolookview")
    public ModelAndView toLookBaseinfoview2(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_looktabs");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("id",JsonUtil.toText(id));
            // 山西个性化需求: 监狱,社矫,看守所查看页面会高亮显示,代码块内容为山西个性化内容,其他省份可忽略
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
                if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                    mav.addObject("prisoner_main","基本信息");
                    mav.addObject("prisoner_fx","服刑信息");
                    mav.addObject("prisoner_sr","社会关系");
                    UserDTO authentication = userService.getAuthentication();
                    if(StrUtil.containsEquals(authentication.getLevel(),Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)){
                        //查找zn与sr表id
                        List<String> priNums = changeTableService.searchChangeTableByPriNum(priNum);
                        List<ChangeTable> changeTables = changeTableService.searchChangeTable(priNum,null,null);
                        for (ChangeTable changeTable : changeTables) {
                            if(StringUtils.equals(changeTable.getTableName(),"prisoner_main")){
                                mav.addObject("prisoner_main","基本信息(被编辑)");
                                break;
                            }
                        }
                        if(null != priNums && 0 != priNums.size()) {
                            mav.addObject("prisoner_sr","社会关系(被编辑)");
                        }
                    }
                }
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 — 已办工作 - 办理详情
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/toDownDetailsView")
    public ModelAndView toDownDetailsView(@RequestParam(required = false, defaultValue = "-1") String id,
                                          @RequestParam(required = false,defaultValue = "-1") String tsId) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/verification/verification-downdetail");
            mav.addObject("id",JsonUtil.toText(tsId));
            PrisonerMainAndHcVo vo = verificationService.getPrisonerMainAndHcVoById(id);
            Result result = prisonerTsService.searchBaseInfoById(tsId);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,String> resultMap = (HashMap<String,String>)result.getData();
                if(StringUtils.isNotBlank(resultMap.get("nativeName"))) {
                    vo.setNativeName(resultMap.get("nativeName"));
                }
            }
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("prisonerHc",vo);
            mav.addObject("level",userDTO.getLevel());
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 监狱核查中 - 回执司法所
     * @param priNum 罪犯编号
     * @param xjrctId 核查回执节点的衔接id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/hc/hzsfs")
    public ModelAndView toHzSfs(@RequestParam String priNum,@RequestParam(required = false, defaultValue = "-1") String xjrctId){
        ModelAndView mav = new ModelAndView();
        try {
            mav.setViewName("/azbj/yazgl/hc_hz_sfs");
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("username",userDTO.getUsername());
            mav.addObject("priNum",priNum);
            mav.addObject("startCheckPerson",userDTO.getDepartName());
            mav.addObject("startCheckPhone",userDTO.getPhone());
            mav.addObject("startCheckTel",userDTO.getTelphone());
            mav.addObject("level",userDTO.getLevel());
            mav.addObject("xjrctId",xjrctId);
            //通过罪犯编号查询是否是监狱送回
            mav.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav.setViewName("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 预安置管理 - 预安置人员核查 - 司法所核查中 - 回执监狱
     * @param priNum  罪犯编号
     * @param xjrctId 核查回执节点的衔接id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/hc/hzjy")
    public ModelAndView toHzJy(@RequestParam String priNum,@RequestParam(required = false, defaultValue = "-1") String xjrctId) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/hc_hz_jy");
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("sender",userDTO.getUsername());
            mav.addObject("username",userDTO.getUsername());
            mav.addObject("phone",userDTO.getPhone());
            mav.addObject("tel",userDTO.getTelphone());
            mav.addObject("priNum",priNum);
            mav.addObject("level",userDTO.getLevel());
            //通过罪犯编号查询是否是监狱送回
            mav.addObject("xjrctId",xjrctId);
            //通过罪犯编号查询是否是监狱送回
            mav.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 待办工作 - 区县司法局回执
     * @param priNum 罪犯编号
     * @param xjrctId 核查回执节点的衔接id
     * @return mav
     */
    @RequestMapping("/azbj/baseinfo/hc/hzsfj")
    public ModelAndView toHzsfj(@RequestParam String priNum,@RequestParam(required = false, defaultValue = "-1") String xjrctId) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/hc_hz_qu");
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("sender",userDTO.getUsername());
            mav.addObject("username",userDTO.getUsername());
            mav.addObject("phone",userDTO.getPhone());
            mav.addObject("tel",userDTO.getTelphone());
            mav.addObject("priNum",priNum);
            mav.addObject("level",userDTO.getLevel());
            mav.addObject("xjrctId",xjrctId);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 待办工作 - 地市司法局回执
     * @param priNum 罪犯编号
     * @param xjrctId 核查回执节点的衔接id
     * @return mav
     */
    @RequestMapping("/azbj/baseinfo/hc/hzdssfj")
    public ModelAndView toHzDsSfj(@RequestParam String priNum,@RequestParam(required = false, defaultValue = "-1") String xjrctId) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/hc_hz_dsfj");
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("sender",userDTO.getUsername());
            mav.addObject("username",userDTO.getUsername());
            mav.addObject("phone",userDTO.getPhone());
            mav.addObject("tel",userDTO.getTelphone());
            mav.addObject("priNum",priNum);
            mav.addObject("level",userDTO.getLevel());
            mav.addObject("xjrctId",xjrctId);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 待办工作 - 地市司法局回执
     * @param priNum 罪犯编号
     * @param xjrctId 核查回执节点的衔接id
     * @return mav
     */
    @RequestMapping("/azbj/baseinfo/hc/hzsft")
    public ModelAndView toHzSft(@RequestParam String priNum,@RequestParam(required = false, defaultValue = "-1") String xjrctId) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/hc_hz_sft");
            UserDTO userDTO = userService.getAuthentication();
            mav.addObject("sender",userDTO.getUsername());
            mav.addObject("username",userDTO.getUsername());
            mav.addObject("phone",userDTO.getPhone());
            mav.addObject("tel",userDTO.getTelphone());
            mav.addObject("priNum",priNum);
            mav.addObject("level",userDTO.getLevel());
            mav.addObject("xjrctId",xjrctId);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 待办工作 - 流程过程
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/toProcess")
    public ModelAndView toProcess(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/to_process");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 — 查看(excel)
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/tolookviewexcel")
    public ModelAndView toLookBaseinfoviewExcel(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_looktabs_excel");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社矫信息查看
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/tosjlookview")
    public ModelAndView toLookBasesjinfoview(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/baseinfo_sj_looktabs");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 信息补录——查看
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseinfo/tobllookview")
    public ModelAndView toLookBlBaseinfoview(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            String tuJing = baseInfoblService.findTuJing(priNum);
            if(Constants.NumberStr.NUM_STR_ZERO_TWO.equals(tuJing)) {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_bljjlook_tabs");
            } else {
                mav = new ModelAndView("/azbj/yazgl/baseinfo_bllook_tabs");
            }
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 全部人员管理--跳转--服刑信息页面
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/addBaseInfo/view/toBjdxFxxxTab")
    public ModelAndView toBjdxFxxxTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxFxxxTab");
            mv.addObject("priNum",priNum);
            mv.addObject("localCode",localCode);
            Result result = bjdxFxInfoService.getFxxxInfoByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转到系统资源下载页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/support/resources")
    public ModelAndView resourcesPage() {
        ModelAndView mv;
        try {
            mv = new ModelAndView("azbj/support/resources");
            String vidoFiles = uploadAppendixService.selectAllVideos(Constants.NumberStr.NUM_STR_ZERO);
            List<Map<String,String>> listObjectFiles = JSONArray.parseObject(vidoFiles,List.class);
            List<Map<String,String>> videoFiles = listObjectFiles.stream().filter(objFile -> "mp4".equals(objFile.get("type"))).collect(Collectors.toList());
            listObjectFiles.removeAll(videoFiles);
            mv.addObject("files",listObjectFiles);
            mv.addObject("videFiles",videoFiles);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: ExcelImportController -----------------------------------

    /**
     * 转到批量导入模版下载界面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/import/excelimport/importfiles")
    public ModelAndView toLookBaseinfoViewImportfiles() {
        return new ModelAndView("/azbj/yazgl/excel_template_import");
    }
    // ----------------------------------- todo: FileExportController -----------------------------------

    /**
     * 描述
     * @param priNum priNum
     * @param type type
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/doc/exportfiles")
    public ModelAndView toExportfilesView(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String type) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/file_export");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            if(Constants.StrFinalValue.XJ.equals(type)) {
                mav.addObject("isxj","true");
            } else {
                mav.addObject("isxj","false");
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 附件补录：主要是监狱用户补录出监评估和刑满释放通知书附件
     * @param priNum priNum
     * @param fileid fileid
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/doc/addfiles")
    public ModelAndView toAddfilesPage(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String fileid) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/yazgl/addfiles");
            String cjpgid = fileid;
            String xmsfid = fileid;
            //查询出监评估（taskid=1）的id
            List<UploadAppendixFile> cjpgList = dadcInfoService.getUploadAppendixFile(priNum,Constants.AppendixFile.APDIX_FILE_ONE);
            if(!cjpgList.isEmpty()) {
                for(UploadAppendixFile u : cjpgList) {
                    cjpgid = u.getId();
                }
            }
            //查询刑满释放通知书（taskid=12）的id
            List<UploadAppendixFile> xmsfList = dadcInfoService.getUploadAppendixFile(priNum,Constants.AppendixFile.APDIX_FILE_TEN_TWO);
            if(!xmsfList.isEmpty()) {
                for(UploadAppendixFile u : xmsfList) {
                    xmsfid = u.getId();
                }
            }
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("cjpgid",JsonUtil.toText(cjpgid));
            mav.addObject("xmsfid",JsonUtil.toText(xmsfid));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: FxyjController -----------------------------------

    /**
     * 跳转 - 数据分析预警
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/tofxyj/view")
    public ModelAndView toSjfxView() {
        return new ModelAndView("/azbj/sjtjfx/fxyj/fxyj");
    }
    // ----------------------------------- todo: GovernmentHelpController -----------------------------------

    /**
     * 跳转新增页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/zfjzbf/baseinfo/view/{flog}")
    public ModelAndView toIndex3(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/zfjzbfgl/zfjzbf_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("adduserid",userDTO.getDepartid());
            modelAndView.addObject("addusername",userDTO.getDepartName());
            modelAndView.addObject("departid",userDTO.getDepartid());
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: HjqcryglController -----------------------------------

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 迁出办理--新增/编辑
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/addPrisonerMvOut/view")
    public ModelAndView addPrisonerMvOut(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxHjqyAddTab");
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                Result result = bjdxMvInfoService.getMvInfoById(id);
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
                String qclxdh = (String)data.get("qclxdh");
                Map<String,String> telAndPhone = PhoneUtil.splitTelAndPhone(qclxdh);
                mv.addObject("qclxdh",telAndPhone.get("phone"));
                mv.addObject("fixedLine",telAndPhone.get("tel"));
                return mv;
            } else {
                id = idGenService.getId();
            }
            UserDTO authentication = userService.getAuthentication();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            mv.addObject("outapplytime",format);
            mv.addObject("id",id);
            mv.addObject("qclxr",authentication.getUsername());
            mv.addObject("qclxdh",authentication.getPhone());
            mv.addObject("fixedLine",authentication.getTelphone());
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 审核页面 - 编辑
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toOutShenhe/view")
    public ModelAndView toShenhe(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqcsh");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getMvBaseInfoByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 审核页面 - 查看
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toOutShenhe/check")
    public ModelAndView toShenheCheck(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqcsh_check");
            Result result = bjdxMvInfoService.getMvBaseInfoForCheck(id);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view")
    public ModelAndView toViewTabs1(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxHjqyViewTabs");
        mv.addObject("priNum",priNum);
        return mv;
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 基本信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/baseInfoTab")
    public ModelAndView toBaseInfoTab1(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxJbxxViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getBaseInfoViewByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 多媒体信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/DmtInfoTab")
    public ModelAndView toDmtInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxDmtxxViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 服刑信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/FxInfoTab")
    public ModelAndView toFxInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxFxxxViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getFxInfoViewByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mv.addAllObjects(map);
            }
            // 山西个性化需求:居住地改为日常居住地
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mv.addObject("localCode",localCode);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 社会关系
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/ShgxInfoTab")
    public ModelAndView toShgxInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxShgxViewTab");
            mv.addObject("priNum",priNum);
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(priNum);
            if(null != prisonerMain) {
                mv.addObject("pname",prisonerMain.getPName());
                mv.addObject("idnum",prisonerMain.getIdNum());
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
        }
        return mv;
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 核查记录
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/HcjlInfoTab")
    public ModelAndView toHcjlInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxHcjlViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getHcjlInfoViewByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                //---------开始改动----------by pzc 2022-07-29
                //改动之后添加都数据格式为：手机号｜固话
                String hcrdh = (String)map.get("hcrdh");
                Map<String,String> dianhua = PhoneUtil.splitTelAndPhone(hcrdh);
                map.put("hcrPhone",dianhua.get("phone"));
                map.put("hcrTel",dianhua.get("tel"));
                //--------结束改动----------by pzc 2022-07-29
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 档案材料
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/DaclInfoTab")
    public ModelAndView toDaclInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxDaclViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getDaclInfoViewByPriNum(priNum);
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(priNum);
            if(null != prisonerMain) {
                mv.addObject("pname",prisonerMain.getPName());
                mv.addObject("idnum",prisonerMain.getIdNum());
                //返回方式
                mv.addObject("fhfs",prisonerXjxxService.selectShfsByPriNum(priNum));
            }
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                //监所联系方式拆分
                Map<String,Object> map = (Map<String,Object>)result.getData();
                if(map.get("dianhua") != null) {
                    Map<String,String> telAndPhone = PhoneUtil.splitTelAndPhone((String)map.get("dianhua"));
                    map.put("jsPhone",telAndPhone.get("phone"));
                    map.put("jsTel",telAndPhone.get("tel"));
                }
                //公安联系方式拆分
                if(map.get("galxfs") != null) {
                    Map<String,String> gaTelAndPhone = PhoneUtil.splitTelAndPhone((String)map.get("galxfs"));
                    map.put("gaPhone",gaTelAndPhone.get("phone"));
                    map.put("gaTel",gaTelAndPhone.get("tel"));
                }
                mv.addObject("localCode",localCode);
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 安置帮教信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/AzbjInfoTab")
    public ModelAndView toAzbjInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxAzbjViewTab");
            mv.addObject("priNum",priNum);
            mv.addObject("localCode",localCode);
            Result result = bjdxMvInfoService.getAzbjInfoViewByPriNum(priNum);
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(priNum);
            if(null != prisonerMain) {
                mv.addObject("pname",prisonerMain.getPName());
                mv.addObject("idnum",prisonerMain.getIdNum());
            }
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                //-------改动开始--------by pzc 2022-07-29
                //获取data中的jzList
                ArrayList<HashMap<String,String>> jzList = (ArrayList<HashMap<String,String>>)map.get("jzList");
                if(!Constants.Number.NUM_ZERO.equals(jzList.size())) {
                    //获取jzList中下标为0的一个map，里面包含救jzMap = {LinkedHashMap@17704}  size = 21"jyTel" -> "13980602002"助信息
                    HashMap<String,String> jzMap = jzList.get(Constants.Number.NUM_ZERO);
                    //获取低保电话
                    String dbdh = jzMap.get("dbTel");
                    //获取教育电话
                    String jydh = jzMap.get("jyTel");
                    //获取其他电话
                    String qtdh = jzMap.get("qtTel");
                    //获取特困电话
                    String tkdh = jzMap.get("tkTel");
                    //获取医疗电话
                    String yldh = jzMap.get("ylTel");
                    //获取住房电话
                    String zfdh = jzMap.get("zfTel");
                    //  ------低保-------
                    Map<String,String> db = PhoneUtil.splitTelAndPhone(dbdh);
                    //  ------教育-------
                    Map<String,String> jy = PhoneUtil.splitTelAndPhone(jydh);
                    //  ------其他-------
                    Map<String,String> qt = PhoneUtil.splitTelAndPhone(qtdh);
                    //  ------特困-------
                    Map<String,String> tk = PhoneUtil.splitTelAndPhone(tkdh);
                    //  ------医疗-------
                    Map<String,String> yl = PhoneUtil.splitTelAndPhone(yldh);
                    //  ------住房-------
                    Map<String,String> zf = PhoneUtil.splitTelAndPhone(zfdh);
                    //将固话和手机号装入mao中，用于前端回显
                    jzMap.put("dbPhone",db.get("phone"));
                    jzMap.put("dbTel",db.get("tel"));
                    jzMap.put("jyPhone",jy.get("phone"));
                    jzMap.put("jyTel",jy.get("tel"));
                    jzMap.put("qtPhone",qt.get("phone"));
                    jzMap.put("qtTel",qt.get("tel"));
                    jzMap.put("tkPhone",tk.get("phone"));
                    jzMap.put("tkTel",tk.get("tel"));
                    jzMap.put("ylPhone",yl.get("phone"));
                    jzMap.put("ylTel",yl.get("tel"));
                    jzMap.put("zfPhone",zf.get("phone"));
                    jzMap.put("zfTel",zf.get("tel"));
                    //-------改动结束--------by pzc 2022-07-29
                }
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 查看 - 双列管
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/SlgInfoTab")
    public ModelAndView toSlgInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxSlgViewTab");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getSlgInfoViewByPriNum(priNum);
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(priNum);
            if(null != prisonerMain) {
                mv.addObject("pname",prisonerMain.getPName());
                mv.addObject("idnum",prisonerMain.getIdNum());
            }
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                //-------改动开始--------by pzc 2022-07-29
                if(null != map.get("approvalTel")) {
                    Map<String,String> telAndPhone = PhoneUtil.splitTelAndPhone((String)map.get("approvalTel"));
                    map.put("spPhone",telAndPhone.get("phone"));
                    map.put("spTel",telAndPhone.get("tel"));
                }
                if(null != map.get("relieveTel")) {
                    Map<String,String> ycTelAndPhone = PhoneUtil.splitTelAndPhone((String)map.get("relieveTel"));
                    map.put("ycPhone",ycTelAndPhone.get("phone"));
                    map.put("ycTel",ycTelAndPhone.get("tel"));
                }
                //-------改动结束--------by pzc 2022-07-29
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: HjqrryglController -----------------------------------

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁入人员管理 - 审核页面 - 编辑
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/toInShenhe/view")
    public ModelAndView toShenhe1(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqrsh");
            mv.addObject("priNum",priNum);
            Result result = bjdxMvInfoService.getMvBaseInfoByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            // 山西个性化需求:户籍迁入审核页面去除司法所意见
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mv.addObject("localCode",localCode);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁入人员管理 - 审核页面 - 查看
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/toInShenhe/check")
    public ModelAndView toShenheCheck1(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqrsh_check");
            mv.addObject("id",id);
            Result result = bjdxMvInfoService.getMvBaseInfoForCheck(id);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁入人员管理 - 审核成功页面 - 查看
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/toInShenhe/checkSuccess")
    public ModelAndView toShenheCheckSuccess1(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqrsh_check_success");
            mv.addObject("id",id);
            Result result = bjdxMvInfoService.getMvBaseInfoForCheck(id);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 户籍迁入人员管理 - 迁入办理 - 新增
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/addPrisonerMvIn/view")
    public ModelAndView addPrisonerMvIn(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqrApply");
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                Date date = new Date();
                String format = simpleDateFormat.format(date);
                mv.addObject("inapplytime",format);
                mv.addObject("id",id);
                Result result = bjdxMvInfoService.getMvInfoById(id);
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: InmatesBlController -----------------------------------

    /**
     * 解矫释放跳转页面---编辑
     * @param prinum prinum
     * @param flag flag
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bl/baseinfo/view")
    public ModelAndView toIndex4(
            @RequestParam(required = false, defaultValue = "-1") String prinum,
            @RequestParam(required = false, defaultValue = "-1") String flag) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("/azbj/yazgl/inmates_bljj_edittabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("flag",flag);
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转到人员信息补录监狱释放界面
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bl/blbaseinfo/view")
    public ModelAndView toBlIndex(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("/azbj/azbjgl/ryxxbl/inmates_edit_bl");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转解矫人员录入基本信息页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bljj/baseinfo/view")
    public ModelAndView toIndexjj() {
        String localCode = CodeUrlUtils.getLocalCode();
        ModelAndView modelAndView = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_edit_bljj");
        modelAndView.addObject("localCode",localCode);
        return modelAndView;
    }

    /**
     * 跳转 多媒体信息增加
     * @param id id
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bl/multiinfo/view")
    public ModelAndView toMultiinfobl(@RequestParam("id") String id,@RequestParam("prinum") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/azbjgl/ryxxbl/multiinfo-add-bl");
            if(!org.springframework.util.StringUtils.isEmpty(prinum)) {
                Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(prinum);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> map = (Map<String,Object>)result.getData();
                    mav.addAllObjects(map);
                }
            }
            mav.addObject("id",id);
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转到监狱服刑信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bl/termedit/view")
    public ModelAndView toSentence(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_sentence_bl");
            mav.addObject("priNum",JsonUtil.toText(priNum));
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 基础信息--附件信息添加
     * @param id id
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates_bl/attachment-relations/view")
    public ModelAndView toAttachment(@RequestParam("id") String id,@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/ryxxbl/jy_attachment");
            mav.addObject("id",id);
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: InmatesController -----------------------------------

    /**
     * 预安置管理 - 预安置人员信息录入 - 基本信息添加
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfo/view")
    public ModelAndView toIndex5() {
        ModelAndView mav = new ModelAndView();
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav.setViewName("azbj/yazgl/inmates_edit");
            mav.addObject("level",userService.getAuthentication().getLevel());
            mav.addObject("localCode",localCode);
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav.setViewName("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 跳转 多媒体信息增加
     * @param id id
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/multiinfo/view")
    public ModelAndView toMultiinfo(@RequestParam("id") String id,@RequestParam("prinum") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/multiinfo-add");
            if(!StringUtils.isEmpty(prinum)) {
                Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(prinum);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> map = (Map<String,Object>)result.getData();
                    mav.addAllObjects(map);
                }
            }
            mav.addObject("id",id);
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 编辑基本信息
     * @param prinum prinum
     * @param successFlag successFlag
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoedit/view")
    public ModelAndView toBaseinfeditView(
            @RequestParam(required = false, defaultValue = "-1") String prinum,String successFlag) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/yazgl/inmates_edittabs");
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("localCode",localCode);
            if(Constants.NumberStr.NUM_STR_ONE.equals(successFlag)) {
                mav.addObject("successFlag",successFlag);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 编辑基本信息excel
     * @param prinum prinum
     * @param successFlag successFlag
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoedit/viewexcel")
    public ModelAndView toBaseinfeditViewExcel(
            @RequestParam(required = false, defaultValue = "-1") String prinum,String successFlag) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/yazgl/inmates_edittabs_excel");
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            mav.addObject("prinum",JsonUtil.toText(prinum));
            if(Constants.NumberStr.NUM_STR_ONE.equals(successFlag)) {
                mav.addObject("successFlag",successFlag);
            }
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 编辑补录基本信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoBledit/view")
    public ModelAndView toBaseinfBleditView(
            @RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/yazgl/inmates_bl_edittabs");
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 查看社矫补录基本信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoBljjLook/view")
    public ModelAndView toBaseinfBljjLookView(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/sqjz/sqjz_inmates_looktabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 查看补录基本信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoBlLook/view")
    public ModelAndView toBaseinfBlLookView(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/yazgl/inmates_bl_looktabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 编辑基本信息 司法所
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfoeditSpecial/view")
    public ModelAndView toBaseinfoEditSpecial(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_edittabs_special");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            // 山西个性化需求:居住地改为日常居住地
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 基本信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfolook/view")
    public ModelAndView toBaseinfolookView(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_looktabs");
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            mav.addObject("prinum",JsonUtil.toText(prinum));
            // 山西个性化需求: 监狱,社矫,看守所查看页面会高亮显示,代码块内容为山西个性化内容,其他省份可忽略
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
                if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                    Set<String> set = new HashSet<>();
                    UserDTO authentication = userService.getAuthentication();
                    if(StrUtil.containsEquals(authentication.getLevel(),Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)){
                        List<ChangeTable> changeTables = changeTableService.searchChangeTable(prinum, "prisoner_main", null);
                        for (ChangeTable changeTable : changeTables) {
                            set.add(changeTable.getFieldName());
                        }
                    }
                    for (String filed : set) {
                        mav.addObject(filed,"true");
                    }
                }
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 基本信息查看excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/baseinfolook/viewexcel")
    public ModelAndView toBaseinfolookViewExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_looktabs_excel");
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: JobRankingController -----------------------------------

    /**
     * 跳转 工作排名
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/JobRanking")
    public ModelAndView toIndex6() {
        return new ModelAndView("azbj/yazgl/jobRanking");
    }
    // ----------------------------------- todo: JytjController -----------------------------------

    /**
     * 跳转新增页面
     * @param request request
     * @param ischeck ischeck
     * @return ModelAndView
     */
    @RequestMapping("/azbj/abzlxxgl/jytjInfoManage/view")
    public ModelAndView toIndex7(HttpServletRequest request,
                                 @RequestParam(required = false, defaultValue = "-1") String ischeck) {
        ModelAndView modelAndView;
        try {
            if(Constants.NumberStr.NUM_STR_FU_ONE.equals(ischeck)) {
                modelAndView = new ModelAndView("azbj/abzlxxgl/jytjInfoManage_edit");
            } else {
                modelAndView = new ModelAndView("azbj/abzlxxgl/jytjInfoManage_see");
            }
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("adduserid",userDTO.getDepartName());
            modelAndView.addObject("upuserid",userDTO.getDepartid());
            modelAndView.addObject("userlevel",userDTO.getLevel());
            //id生成器生成的uuid
            modelAndView.addObject("id",IdGen.strid());
            modelAndView.addObject("ischeck",ischeck);
            modelAndView.addObject("province",userDTO.getDepartid().substring(0,2) + "0000");
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: MediaController -----------------------------------

    /**
     * 跳转 多媒体信息增加
     * @param id id
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/multiinfoedit/view")
    public ModelAndView toMutilEdit(@RequestParam("id") String id,@RequestParam("prinum") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/multiinfo-edit");
            Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(prinum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mav.addAllObjects(map);
            }
            mav.addObject(id,JsonUtil.toText(id));
            mav.addObject(prinum,JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 多媒体信息查看
     * @param id id
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/multiinfolook/view")
    public ModelAndView toMutilLook(@RequestParam("id") String id,@RequestParam("prinum") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/multiinfo-look");
            Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(prinum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mav.addAllObjects(map);
            }
            mav.addObject(id,JsonUtil.toText(id));
            mav.addObject(prinum,JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: NoticeInfoManageController -----------------------------------

    /**
     * 跳转通知公告信息列表
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/azbj/tzgggl/getNoticeInfoList/view")
    public ModelAndView toIndex8(@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/tzgggl/list_tzgg");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
                modelAndView.addObject("createUser",userDTO.getAccount());
                modelAndView.addObject("clab",userDTO.getDepartid());
                modelAndView.addObject("clab_name",userDTO.getDepartName());
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转通知公告信息新增页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/tzgggl/noticeInfoManage/add")
    public ModelAndView toNoticeInfoManageAdd() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/tzgggl/noticeInfoManage_add");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            //发布单位
            modelAndView.addObject("addgovid",userDTO.getDepartid());
            //发布等级
            modelAndView.addObject("fabulevel",userDTO.getLevel());
            //用户等级
            modelAndView.addObject("userlevel",userDTO.getLevel());
            //添加日期
            modelAndView.addObject("adddate",DateUtil.getDate());
            //id生成器生成的uuid
            modelAndView.addObject("id",IdGen.strid());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转通知公告信息编辑页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/tzgggl/noticeInfoManage/edit")
    public ModelAndView toNoticeInfoManageEdit() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/tzgggl/noticeInfoManage_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("update_user",userDTO.getAccount());
            //发布单位
            modelAndView.addObject("updateId",userDTO.getDepartid());
            //用户等级
            modelAndView.addObject("userlevel",userDTO.getLevel());
            //添加日期
            modelAndView.addObject("adddate",DateUtil.getDate());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转通知公告查看
     * @return ModelAndView
     */
    @RequestMapping("/azbj/tzgggl/noticeInfoManage/lookUp")
    public ModelAndView toNoticeInfo() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/tzgggl/noticeInfo");
            UserDTO userDTO = userService.getAuthentication();
            //发布单位
            modelAndView.addObject("addgovid",userDTO.getDepartid());
            //发布等级
            modelAndView.addObject("fabulevel",userDTO.getLevel());
            //用户等级
            modelAndView.addObject("userlevel",userDTO.getLevel());
            //添加日期
            modelAndView.addObject("adddate",DateUtil.getDate());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: PlacementBaseInfoController -----------------------------------

    /**
     * 跳转安帮基地信息信息编辑页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jdxxgl/placementBaseInfo/edit/{flog}/flag/{flag}")
    public ModelAndView toPlacementBaseInfoEdit(@PathVariable String flog,@PathVariable String flag) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/jdxxgl/placementBaseInfo_edit");
            // 山西个性化需求:上传基地认证 证明材料
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView.addObject("id", IdGen.strid());
            modelAndView.addObject("localCode",localCode);
            modelAndView.addObject("flog",flog);
            modelAndView.addObject("flag",flag);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: PrisonerHelpController -----------------------------------

    /**
     * 帮教工作信息管理管理 - 救助 - 救助信息 - listTab
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toSuccourTab")
    public ModelAndView toSuccourTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJzListTab");
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mv.addObject("priNum",priNum);
            mv.addObject("localCode",localCode);
            //获取基本信息
            Result result = bjgzInfoService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                if (ObjectUtils.isEmpty(data.get("jzdz"))) {
                    data.remove("jzdz");
                }
                mv.addAllObjects(data);
            }
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            mv.addObject("inapplytime",format);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--救助--救助信息-editTab
     * @param priNum priNum
     * @param jzId jzId
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toEditSuccourTab")
    public ModelAndView toEditSuccourTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String jzId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJzTab");
            mv.addObject("priNum",priNum);
            if(!StringUtils.equals(jzId,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("edit","true");
                //获取基本信息
                Result result = bjgzInfoService.getJzBaseInfo(jzId);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    //拆分手机号码和固话---------by pzc-----start--0802
                    if(data.get("dbTel") != null) {
                        Map<String,String> db = PhoneUtil.splitTelAndPhone((String)data.get("dbTel"));
                        data.put("dbTel",db.get("tel"));
                        data.put("dbPhone",db.get("phone"));
                    }
                    if(data.get("tkTel") != null) {
                        Map<String,String> tk = PhoneUtil.splitTelAndPhone((String)data.get("tkTel"));
                        data.put("tkTel",tk.get("tel"));
                        data.put("tkPhone",tk.get("phone"));
                    }
                    if(data.get("ylTel") != null) {
                        Map<String,String> yl = PhoneUtil.splitTelAndPhone((String)data.get("ylTel"));
                        data.put("ylTel",yl.get("tel"));
                        data.put("ylPhone",yl.get("phone"));
                    }
                    if(data.get("jyTel") != null) {
                        Map<String,String> jy = PhoneUtil.splitTelAndPhone((String)data.get("jyTel"));
                        data.put("jyTel",jy.get("tel"));
                        data.put("jyPhone",jy.get("phone"));
                    }
                    if(data.get("zfTel") != null) {
                        Map<String,String> zf = PhoneUtil.splitTelAndPhone((String)data.get("zfTel"));
                        data.put("zfTel",zf.get("tel"));
                        data.put("zfPhone",zf.get("phone"));
                    }
                    if(data.get("qtTel") != null) {
                        Map<String,String> qt = PhoneUtil.splitTelAndPhone((String)data.get("qtTel"));
                        data.put("qtTel",qt.get("tel"));
                        data.put("qtPhone",qt.get("phone"));
                    }
                    //拆分手机号码和固话---------by pzc-----end--0802
                    mv.addAllObjects(data);
                }
                // 根据id priNum taskId查询上传文件数量 27 28 29 30 31 32
                Result result1 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_SEVEN);
                Result result2 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_EIGHT);
                Result result3 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_NINE);
                Result result4 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_ZERO);
                Result result5 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_ONE);
                Result result6 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_TWO);
                mv.addObject("count1",result1.getData());
                mv.addObject("count2",result2.getData());
                mv.addObject("count3",result3.getData());
                mv.addObject("count4",result4.getData());
                mv.addObject("count5",result5.getData());
                mv.addObject("count6",result6.getData());
            } else {
                jzId = idGenService.getId();
                // 根据id priNum taskId查询上传文件数量 27 28 29 30 31 32
                Result result1 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_SEVEN);
                Result result2 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_EIGHT);
                Result result3 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_TWENTY_NINE);
                Result result4 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_ZERO);
                Result result5 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_ONE);
                Result result6 = uploadAppendixService.getCountById(priNum,jzId,Constants.AppendixFile.APDIX_FILE_THIRTY_TWO);
                mv.addObject("count1",result1.getData());
                mv.addObject("count2",result2.getData());
                mv.addObject("count3",result3.getData());
                mv.addObject("count4",result4.getData());
                mv.addObject("count4",result4.getData());
                mv.addObject("count5",result5.getData());
                mv.addObject("count6",result6.getData());
                mv.addObject("id",jzId);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--救助--救助信息-查看
     * @param priNum priNum
     * @param jzId jzId
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toViewSuccourTab")
    public ModelAndView toViewSuccourTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String jzId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJzViewTab");
            mv.addObject("priNum",priNum);
            if(!StringUtils.equals(jzId,Constants.NumberStr.NUM_STR_FU_ONE)) {
                //获取基本信息
                Result result = bjgzInfoService.getJzBaseInfo(jzId);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    //------
                    if(data.get("dbTel") != null && !"".equals(data.get("dbTel"))) {
                        Map<String,String> db = PhoneUtil.splitTelAndPhone((String)data.get("dbTel"));
                        data.put("dbPhone",db.get("phone"));
                        data.put("dbTel",db.get("tel"));
                    }
                    if(data.get("tkTel") != null && !"".equals(data.get("tkTel"))) {
                        Map<String,String> tk = PhoneUtil.splitTelAndPhone((String)data.get("tkTel"));
                        data.put("tkPhone",tk.get("phone"));
                        data.put("tkTel",tk.get("tel"));
                    }
                    if(data.get("ylTel") != null && !"".equals(data.get("ylTel"))) {
                        Map<String,String> yl = PhoneUtil.splitTelAndPhone((String)data.get("ylTel"));
                        data.put("ylPhone",yl.get("phone"));
                        data.put("ylTel",yl.get("tel"));
                    }
                    if(data.get("jyTel") != null && !"".equals(data.get("jyTel"))) {
                        Map<String,String> jy = PhoneUtil.splitTelAndPhone((String)data.get("jyTel"));
                        data.put("jyPhone",jy.get("phone"));
                        data.put("jyTel",jy.get("tel"));
                    }
                    if(data.get("zfTel") != null && !"".equals(data.get("zfTel"))) {
                        Map<String,String> zf = PhoneUtil.splitTelAndPhone((String)data.get("zfTel"));
                        data.put("zfPhone",zf.get("phone"));
                        data.put("zfTel",zf.get("tel"));
                    }
                    if(data.get("qtTel") != null && !"".equals(data.get("qtTel"))) {
                        Map<String,String> qt = PhoneUtil.splitTelAndPhone((String)data.get("qtTel"));
                        data.put("qtPhone",qt.get("phone"));
                        data.put("qtTel",qt.get("tel"));
                    }
                    mv.addAllObjects(data);
                }
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理 - 帮教 - 帮教信息 - listTab
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toHelpTab")
    public ModelAndView toHelpTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglBjListTab");
        try {
            mv.addObject("priNum",priNum);
            //获取基本信息
            Result result = bjgzInfoService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                if (ObjectUtils.isEmpty(data.get("jzdz"))) {
                    data.remove("jzdz");
                }
                mv.addAllObjects(data);
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
        }
        return mv;
    }

    /**
     * 帮教工作信息管理管理--帮教--帮教信息-editTab
     * @param priNum priNum
     * @param pp pp
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toAddBjInfoTab")
    public ModelAndView toAddBjInfoTab(HttpServletRequest request,
                                       @RequestParam(required = false, defaultValue = "-1") String priNum,
                                       @RequestParam(required = false, defaultValue = "-1") String pp) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglBjTab");
            mv.addObject("priNum",priNum);
            if(!StringUtils.equals(pp,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("pp",pp);
                //获取帮扶基本信息
                Result resultBf = bjgzInfoService.getBjBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultBf.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultBf.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--党政--基本信息
                Result resultDz = bjgzInfoService.getBjDzBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultDz.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultDz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--社会组织--基本信息
                Result resultShzz = bjgzInfoService.getBjShzzBaseInfo(pp);
                if (Constants.Number.NUM_ONE.equals(resultShzz.getCode())) {
                    Map<String, Object> data = (Map<String, Object>) resultShzz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--志愿者--基本信息
                Result resultZyz = bjgzInfoService.getBjZyzBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultZyz.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultZyz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--排查--基本信息
                Result resultPc = bjgzInfoService.getBjPcBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultPc.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultPc.getData();
                    mv.addAllObjects(data);
                }
                Result result1 = uploadAppendixService.getCountById(priNum,pp,Constants.NumberStr.NUM_STR_TEN_FOUR);
                Result result2 = uploadAppendixService.getCountById(priNum,pp,Constants.NumberStr.NUM_STR_TEN_FIVE);
                Result result3 = uploadAppendixService.getCountById(priNum,pp,Constants.NumberStr.NUM_STR_TEN_SEVEN);
                Result result4 = uploadAppendixService.getCountById(priNum,pp,Constants.NumberStr.NUM_STR_TEN_EIGHT);
                Result result5 = uploadAppendixService.getCountById(priNum,pp,Constants.NumberStr.NUM_STR_TEN_NINE);
                mv.addObject("count1",result1.getData());
                mv.addObject("count2",result2.getData());
                mv.addObject("count3",result3.getData());
                mv.addObject("count4",result4.getData());
                mv.addObject("count5",result5.getData());
            } else {
                pp = IdGen.strid();
                // 根据id priNum taskId查询上传文件数量 14 15 17 18 19
                Result result1 = uploadAppendixService.getCountById(priNum,pp,Constants.AppendixFile.APDIX_FILE_TEN_FOUR);
                Result result2 = uploadAppendixService.getCountById(priNum,pp,Constants.AppendixFile.APDIX_FILE_TEN_FIVE);
                Result result3 = uploadAppendixService.getCountById(priNum,pp,Constants.AppendixFile.APDIX_FILE_TEN_SEVEN);
                Result result4 = uploadAppendixService.getCountById(priNum,pp,Constants.AppendixFile.APDIX_FILE_TEN_EIGHT);
                Result result5 = uploadAppendixService.getCountById(priNum,pp,Constants.AppendixFile.APDIX_FILE_TEN_NINE);
                mv.addObject("count1",result1.getData());
                mv.addObject("count2",result2.getData());
                mv.addObject("count3",result3.getData());
                mv.addObject("count4",result4.getData());
                mv.addObject("count5",result5.getData());
                mv.addObject("pp",pp);
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
        }
        return mv;
    }

    /**
     * 帮教工作信息管理管理--帮教--帮教信息-editTab
     * @param priNum priNum
     * @param pp pp
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toViewBjInfoTab")
    public ModelAndView toViewBjInfoTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String pp) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglBjViewTab");
            mv.addObject("priNum",priNum);
            if(!StringUtils.equals(pp,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("pp",pp);
                //获取帮扶基本信息
                Result resultBf = bjgzInfoService.getBjBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultBf.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultBf.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--党政--基本信息
                Result resultDz = bjgzInfoService.getBjDzBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultDz.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultDz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--社会组织--基本信息
                Result resultShzz = bjgzInfoService.getBjShzzBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultShzz.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultShzz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--志愿者--基本信息
                Result resultZyz = bjgzInfoService.getBjZyzBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultZyz.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultZyz.getData();
                    mv.addAllObjects(data);
                }
                //获取帮扶--排查--基本信息
                Result resultPc = bjgzInfoService.getBjPcBaseInfo(pp);
                if(Constants.Number.NUM_ONE.equals(resultPc.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)resultPc.getData();
                    mv.addAllObjects(data);
                }
            } else {
                pp = IdGen.strid();
                mv.addObject("pp",pp);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--年度鉴定--List
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAppraiseListTabs")
    public ModelAndView toAppraiseListTabs(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJdListTab");
            mv.addObject("priNum",priNum);
            //获取基本信息
            Result result = bjgzInfoService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--年度鉴定--Tabs
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAddAppraiseTabs")
    public ModelAndView toAddAppraiseTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJdTab");
            mv.addObject("priNum",priNum);
            //获取基本信息
            Result result = bjgzInfoService.getPingguInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--年度鉴定--鉴定
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAppraiseTab")
    public ModelAndView toAppraiseTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJdTab");
            if(!StringUtils.equals(priNum,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("priNum",priNum);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理--年度鉴定--编辑
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toEditAppraiseTab")
    public ModelAndView toEditAppraiseTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJdTab");
            if(!StringUtils.equals(priNum,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("priNum",priNum);
                //获取鉴定信息
                Result result = bjgzInfoService.getJdEditBaseInfo(priNum,id);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    mv.addAllObjects(data);
                }
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 帮教工作信息管理管理 - 年度鉴定 - 查看
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toViewAppraiseTabs")
    public ModelAndView toViewAppraiseTabs(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjgzgl/bjglJdViewTab");
            if(!StringUtils.equals(priNum,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("priNum",priNum);
                //获取鉴定信息
                Result result = bjgzInfoService.getJdViewBaseInfo(priNum,id);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    mv.addAllObjects(data);
                }
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: PrisonerSettleController -----------------------------------

    /**
     * 前提条件：不吸毒或者解除了吸毒。
     * 安置工作信息管理管理 - 安置 - 安置信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAzInfoTab")
    public ModelAndView toAzInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/azgzgl/azglAzTab");
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mv.addObject("priNum",priNum);
            mv.addObject("localCode",localCode);
            //获取人员及安置信息
            //获取当前部门id
            String departid = userService.getAuthentication().getDepartid();
            Result result = azgzInfoService.getAzBaseInfonList(priNum,departid);
            if(Constants.Number.NUM_ONE.equals(result.getCode())){
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置工作信息管理管理 - 安置 - 新增安置信息
     * @param priNum priNum
     * @param azId azId
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAddAzInfoTab")
    public ModelAndView toAddAzInfoTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String azId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/azgzgl/azglAzAddTab");
            mv.addObject("priNum",priNum);
            if(!StringUtils.equals(azId,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("edit","true");
                //获取安置信息
                Result result = azgzInfoService.getAzBaseInfo(azId);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    if(null != data.get("pxrdh")) {
                        Map<String,String> telAndPhone = PhoneUtil.splitTelAndPhone((String)data.get("pxrdh"));
                        data.put("pxrphone",telAndPhone.get("phone"));
                        data.put("pxrtel",telAndPhone.get("tel"));
                    }
                    mv.addAllObjects(data);
                }
                // 根据id priNum taskId查询上传文件数量 25
                Result result1 = uploadAppendixService.getCountById(priNum,azId,Constants.AppendixFile.APDIX_FILE_TWENTY_FIVE);
                mv.addObject("count1",result1.getData());
            } else {
                azId = idGenService.getId();
                mv.addObject("azId",azId);
                mv.addObject("edit","false");
                Result result = azgzInfoService.getCertsByPrinum(priNum);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    mv.addAllObjects(data);
                }
                // 根据id priNum taskId查询上传文件数量  25
                Result result1 = uploadAppendixService.getCountById(priNum,azId,Constants.AppendixFile.APDIX_FILE_TWENTY_FIVE);
                mv.addObject("count1",result1.getData());
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
        return mv;
    }

    /**
     * 跳转移出基地|移至其他基地页面
     * @param priNum priNum
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/moveJd")
    public ModelAndView moveJdView(HttpServletRequest request,
                                   @RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/jdxxgl/switchMoveWay");
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            // 是否批量移出:false
            paramMap.put("isPlyc","false");
            if(!StringUtils.isEmpty(priNum)) {
                paramMap.put("prinum",priNum);
            }
            mv.addObject("paramMap",paramMap);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转移出基地页面
     * @param request request
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/moveJdChange")
    public ModelAndView moveJdChangeView(HttpServletRequest request,
                                         @RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/jdxxgl/moveBase");
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            paramMap.put("isPlyc","false");
            if(!StringUtils.isEmpty(priNum)) {
                paramMap.put("priNum",priNum);
                mv.addObject("priNum",priNum);
            }
            mv.addObject("paramMap",paramMap);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转移出基地页面
     * @param request request
     * @param priNums priNums
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/moveJdChangePl")
    public ModelAndView moveJdChangePlView(HttpServletRequest request,
                                           @RequestParam(required = false, defaultValue = "-1") String priNums) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/jdxxgl/moveBase");
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            paramMap.put("isPlyc","true");
            if(!StringUtils.isEmpty(priNums)) {
                paramMap.put("priNum",priNums);
                mv.addObject("priNum",priNums);
            }
            mv.addObject("paramMap",paramMap);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转批量发起移出页面
     * @param request request
     * @param prinums prinums
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/plview")
    public ModelAndView plview(HttpServletRequest request,@RequestParam String... prinums) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/jdxxgl/switchMoveWay");
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            // 是否批量移出基地:true
            paramMap.put("isPlyc","true");
            StringBuilder stringBuilder = new StringBuilder();
            int length = prinums.length;
            for(String prinum : prinums) {
                stringBuilder.append(prinum).append("|");
            }
            paramMap.put("prinum",stringBuilder.toString());
            modelAndView.addObject("paramMap",paramMap);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转新增基地人数
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/saveNum")
    public ModelAndView saveNumView(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/jdxxgl/placementJd");
            //获取可安置数量Map
            Map<String,Integer> stringStringMap = azgzInfoService.selectKeAnZhiNum(id);
            if(ObjectUtils.allNotNull(stringStringMap) && !StringUtils.isEmpty(id)) {
                mv.addObject("keanzhirenshu",stringStringMap.get("keanzhirenshu"));
                mv.addObject("id",id);
            } else {
                mv.addObject("id",IdGen.strid());
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 全部人员管理 - 设置帮教小组 - 已移出 - 重新安置
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/azgzgl/view/toAzInfoAgainTab")
    public ModelAndView toAzInfoAgainTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/azgzgl/azglAzAgainTab");
            mv.addObject("priNum",priNum);
            //获取人员及安置信息
            Result result = azgzInfoService.getAzBaseInfonAgainList(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: PrisonerVisitController -----------------------------------

    /**
     * 安置工作信息管理管理 - 帮教对象信息管理 - 帮教对象走访管理 - 走访信息页面
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/view/toAddZfInfoTab")
    public ModelAndView toZfInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxzf/bjdxZfTab");
            mv.addObject("priNum",priNum);
            //获取人员及安置信息
            Result result = prisonerVisitService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置工作信息管理管理 - 帮教对象信息管理 - 帮教对象走访管理 - 走访 - 新增走访信息
     * @param priNum 服刑人员编号
     * @param zfId 走访编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjdxzf/view/toAddZfInfoTab")
    public ModelAndView toAddZfInfoTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String zfId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxzf/bjdxZfAddTab");
            mv.addObject("priNum",priNum);
            // 获取服刑人员基本信息
            Result baseInfo = prisonerVisitService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(baseInfo.getCode())) {
                Map<String,Object> data = (Map<String,Object>)baseInfo.getData();
                mv.addAllObjects(data);
            }
            if(!StringUtils.equals(zfId,Constants.NumberStr.NUM_STR_FU_ONE)) {
                // 修改
                mv.addObject("edit","true");
                //获取走访信息
                Result result = prisonerVisitService.getzfBaseInfo(zfId);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> data = (Map<String,Object>)result.getData();
                    // 根据id priNum taskId查询上传文件数量 16
                    Result result1 = uploadAppendixService.getCountById(priNum,zfId,Constants.AppendixFile.APDIX_FILE_TEN_SIX);
                    mv.addObject("count1",result1.getData());
                    mv.addAllObjects(data);
                }
            } else {
                // 新增
                String id = idGenService.getId();
                mv.addObject("zfId",id);
                UserDTO user = userService.getAuthentication();
                String username = user.getUsername();
                String departName = user.getDepartName();
                String phone = user.getPhone();
                String telphone = user.getTelphone();
                // 根据id priNum taskId查询上传文件数量 16
                Result result1 = uploadAppendixService.getCountById(priNum,id,Constants.AppendixFile.APDIX_FILE_TEN_SIX);
                mv.addObject("count1",result1.getData());
                mv.addObject("zoufangPerson",username);
                mv.addObject("zoufangDanwei",departName);
                mv.addObject("phone",phone);
                mv.addObject("telPhone",telphone);
                mv.addObject("edit","false");
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
        }
        return mv;
    }

    /**
     * 安置帮教管理 - 帮教工作信息管理 - 帮教对象走访管理 - 走访 - 查看
     * @param priNum 服刑人员编号
     * @param zfId 走访编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/azbjgl/bjgzgl/view/toViewZfInfoTab")
    public ModelAndView toViewZfInfoTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String zfId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxzf/bjdxZfViewTab");
            // 获取服刑人员基本信息
            Result baseInfo = prisonerVisitService.getPrisonerBaseInfo(priNum);
            if(Constants.Number.NUM_ONE.equals(baseInfo.getCode())) {
                Map<String,Object> data = (Map<String,Object>)baseInfo.getData();
                mv.addAllObjects(data);
            }
            //获取走访信息
            Result result = prisonerVisitService.getzfBaseInfo(zfId);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 安置帮教管理 - 帮教对象信息管理 - 全部人员管理 - 查看 - tab
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/toBjdxZfInfoTab")
    public ModelAndView toBjdxZfInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxzf/toBjdxZfViewTab");
            mv.addObject("priNum",priNum);
            List<Map<String,Object>> zfInfoList = prisonerVisitService.getZfInfoList(priNum);
            Result prisonerBaseInfo = prisonerVisitService.getPrisonerBaseInfo(priNum);
            if(CollectionUtils.isNotEmpty(zfInfoList)) {
                mv.addObject("zfInfoList",zfInfoList);
            }
            if(Constants.Number.NUM_ONE.equals(prisonerBaseInfo.getCode())) {
                Map<String,Object> map = (Map<String,Object>)prisonerBaseInfo.getData();
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: QbryglController -----------------------------------

    /**
     * 全部人员管理 - 编辑大页面 - 普通服刑人员
     * @param priNum priNum
     * @param pmid pmid
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/editBaseInfo/view")
    public ModelAndView toAbSetTabs(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String pmid) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/bjdxInfo/abSetTabs");
            if(StringUtils.isNotBlank(priNum)) {
                PrisonerMain prisonerMain = baseInfoblService.getPrisonerPstate(priNum);
                String pstate = prisonerMain.getPstate();
                //1、如果pstate为01或者07，说明该服刑人员为补录人员
                if(StrUtil.containsEquals(pstate,Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_DSSFJ)) {
                    //判断是社矫录入还是监狱释放录入
                    ModelAndView modelAndView = toBlEidtTabs(priNum,pmid);
                    modelAndView.addObject("flag",Constants.NumberStr.NUM_STR_ONE);
                    return modelAndView;
                }
                mav.addObject("priNum",JsonUtil.toText(priNum));
                mav.addObject("pmid",JsonUtil.toText(pmid));
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 全部人员管理 - 设置帮教小组
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/toSetBjxz/view")
    public ModelAndView toSetBjxz(
            @RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/setBjxz");
        try {
            UserDTO user = userService.getAuthentication();
            mv.addObject("nowuserid",user.getAccount());
            mv.addObject("priNum",priNum);
            Result result = bjdxInfoService.getBaseInfoByPriNum(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            //查询帮教小组附件的上传文件数量 24
            Result result1 = uploadAppendixService.getCountAll(priNum,Constants.AppendixFile.APDIX_FILE_TWENTY_FOUR);
            mv.addObject("count1",result1.getData());
            // 山西个性化需求:设置帮教小组中的人员表格新增类别
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mv.addObject("localCode",localCode);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 山西个性化需求: 帮教小组、救助、帮扶、安置合起来
     * @param priNum priNum
     * @param type 0:帮教小组 1:安置 3:救助 4:帮扶
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/toAllTab/view")
    public ModelAndView toAllTab(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") Integer type) {
        ModelAndView mv = null;
        try{
            // 山西个性化需求:帮教小组、救助、帮扶、安置合起来
            String localCode = CodeUrlUtils.getLocalCode();
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                // 判断是否吸毒,如果吸毒就只能设置帮教小组
                String cjpgInfo = xxblService.selectCjpgInfoByPrNum(priNum);
                PrisonerCjpg prisonerCjpg = JsonUtil.toBean(cjpgInfo,PrisonerCjpg.class);
                if(null != prisonerCjpg) {
                    String xd = prisonerCjpg.getXd();
                    if(StringUtils.isNotBlank(xd) && Constants.NumberStr.NUM_STR_ONE.equals(xd)) {
                        return toSetBjxz(priNum);
                    }else {
                        mv = new ModelAndView("/azbj/azbjgl/azbjgl_updateall");
                        mv.addObject("tabType",type);
                        mv.addObject("priNum",priNum);
                    }
                } else {
                    mv = new ModelAndView("/azbj/azbjgl/azbjgl_updateall");
                    mv.addObject("tabType",type);
                    mv.addObject("priNum",priNum);
                }
                // 帮教小组页面
            } else if(Constants.Number.NUM_ZERO.equals(type)){
                return toSetBjxz(priNum);
                // 安置页面
            } else if(Constants.Number.NUM_ONE.equals(type)) {
                return toAzInfoTab(priNum);
                // 救助页面
            } else if(Constants.Number.NUM_TWO.equals(type)){
                return toSuccourTab(priNum);
                // 帮扶页面
            } else if (Constants.Number.NUM_THREE.equals(type)) {
                return toHelpTab(priNum);
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
        return mv;
    }

    /**
     * 全部人员管理 - 编辑 - 基本信息
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/addBaseInfo/view/toBjdxJbxxTab")
    public ModelAndView toBjdxJbxxTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxJbxxTab");
            mv.addObject("prinum",JsonUtil.toText(priNum));
            // 山西个性化需求:居住地改为日常居住地
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mv.addObject("localCode",localCode);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 全部人员管理 - 编辑 - 多媒体信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/addBaseInfo/view/toBjdxDmtxxTab")
    public ModelAndView toBjdxDmtxxTab(@RequestParam("id") String id,@RequestParam("prinum") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxDmtxxTab");
            Result result = bjdxMvInfoService.getDmtInfoViewByPriNum(prinum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mav.addAllObjects(map);
            }
            mav.addObject("id",JsonUtil.toText(id));
            mav.addObject(prinum,JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 安置帮教对象 - 全部人员管理 - 编辑基本信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/qbrygl/sqjz/baseinfoedit")
    public ModelAndView toBaseinfoEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/bjdxInfo/sqjz_baseinfoedit");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: ReleaseHelpEduController -----------------------------------

    /**
     * 申请解除跳转页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jcbjgl/applyReleaseHelpEdu/edit")
    public ModelAndView toApplyReleaseHelpEduEdit(@RequestParam String jieChuAutoDate) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/jcbjgl/ApplyReleaseHelpEdu_edit");
            // 山西个性化功能:申请解除帮教页面中的解除总结更改为备注
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView.addObject("localCode",localCode);
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clab_name",userDTO.getDepartName());
            modelAndView.addObject("orgid",userDTO.getOrgid());
            //将解除帮教的日期
            modelAndView.addObject("jieChuAutoDate",jieChuAutoDate);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 重新申请解除跳转页面
     * @param jieChuAutoDate 理想中的解除帮教时间
     * @param releaseDate1 库中实际的解除帮教时间
     * @param id 记录的id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jcbjgl/applyReleaseHelpEdu/editAgain")
    public ModelAndView toApplyReleaseHelpEduEditAgain(@RequestParam(value = "jieChuAutoDate",required = false) String jieChuAutoDate,
                                                       @RequestParam(value = "releaseDate1",required = false) String releaseDate1,
                                                       @RequestParam(value = "id",required = false) String id) {
        ModelAndView modelAndView;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView = new ModelAndView("azbj/jcbjgl/ApplyReleaseHelpEdu_editAgain");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clab_name",userDTO.getDepartName());
            modelAndView.addObject("orgid",userDTO.getOrgid());
            //将计算后的3年/5年解除帮教时间  和 申请后库中存的实际时间写入页面中
            modelAndView.addObject("jieChuAutoDate",jieChuAutoDate);
            modelAndView.addObject("releaseDate1",releaseDate1);
            modelAndView.addObject("id",id);
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 申请解除查看页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jcbjgl/applyReleaseHelpEdu/check")
    public ModelAndView toApplyReleaseHelpEduCheck() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/jcbjgl/ApplyReleaseHelpEdu_check");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clab_name",userDTO.getDepartName());
            modelAndView.addObject("orgid",userDTO.getOrgid());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 申请解除跳转页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jcbjgl/auditingReleaseHelpEdu/edit")
    public ModelAndView toAuditingReleaseHelpEduEdit(@RequestParam(value = "jieChuAutoDate") String jieChuAutoDate) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/jcbjgl/AuditingReleaseHelpEdu_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clab_name",userDTO.getDepartName());
            modelAndView.addObject("orgid",userDTO.getOrgid());
            //将解除帮教的日期
            modelAndView.addObject("jieChuAutoDate",jieChuAutoDate);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 安置帮教管理 - 解除帮教管理 - 申请解除查看
     * @return ModelAndView
     */
    @RequestMapping("/azbj/jcbjgl/auditingReleaseHelpEdu/check")
    public ModelAndView toAuditingReleaseHelpEduCheck() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/jcbjgl/AuditingReleaseHelpEdu_check");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clab_name",userDTO.getDepartName());
            modelAndView.addObject("orgid",userDTO.getOrgid());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 安置帮教管理 - 解除安置帮教 - 查看审核原因
     * @param priNum 罪犯编号
     * @param jieChuAutoDate 申请时计算的理论帮教解除时间
     * @param releaseDate1 库中实际存的解除帮教时间
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/auditResult")
    public ModelAndView auditResult(@RequestParam(value = "priNum", required = false) String priNum,
                                    @RequestParam(value = "jieChuAutoDate", required = false) String jieChuAutoDate,
                                    @RequestParam(value = "releaseDate1",required = false) String releaseDate1) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/jcbjgl/AuditResult");
            mv.addObject("priNum",priNum);
            UserDTO userDTO = userService.getAuthentication();
            String failurContent = releaseHelpEduService.getAuditResult(priNum);
            mv.addObject("failur_content",failurContent);
            mv.addObject("create_user",userDTO.getAccount());
            mv.addObject("clab",userDTO.getDepartid());
            mv.addObject("clab_name",userDTO.getDepartName());
            mv.addObject("orgid",userDTO.getOrgid());
            //解除帮教的日期
            mv.addObject("jieChuAutoDate",jieChuAutoDate);
            //将不是期满解除的日期写到查看页面中
            mv.addObject("releaseDate1",releaseDate1);
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: ReportInfoManageController -----------------------------------

    /**
     * 跳转上报协调信息列表
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sbxtgl/reportInfoManage_list/view")
    public ModelAndView toIndex9(@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/sbxtgl/list_sbxt");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
                modelAndView.addObject("createUser",userDTO.getAccount());
                modelAndView.addObject("clab",userDTO.getDepartid());
                modelAndView.addObject("clab_name",userDTO.getDepartName());
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转上报协调新增页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sbxtgl/reportInfoManage/edit")
    public ModelAndView toReportInfoManageEdit() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/sbxtgl/reportInfoManage_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("create_user",userDTO.getAccount());
            modelAndView.addObject("addgovid",userDTO.getDepartid());
            modelAndView.addObject("updanwei",userDTO.getOrgid());
            modelAndView.addObject("jglevel",userDTO.getLevel());
            modelAndView.addObject("sendtime",DateUtil.getDate());
            modelAndView.addObject("tip_flag",Constants.NumberStr.NUM_STR_TWO);
            //id生成器生成的uuid
            modelAndView.addObject("id",IdGen.strid());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转上报协调回复页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sbxtgl/replyInfo/edit")
    public ModelAndView toReplyInfoEdit() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/sbxtgl/replyInfo_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("addgovid",userDTO.getDepartid());
            modelAndView.addObject("jglevel",userDTO.getLevel());
            modelAndView.addObject("replytime",DateUtil.getDate());
            modelAndView.addObject("readtime",DateUtil.getDate());
            modelAndView.addObject("reply_flag",Constants.NumberStr.NUM_STR_ONE);
            modelAndView.addObject("upload_flag",Constants.NumberStr.NUM_STR_TWO);
            modelAndView.addObject("tip_flag",Constants.NumberStr.NUM_STR_ONE);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转上报协调查看页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sbxtgl/reportInfoManage/lookUp")
    public ModelAndView toReplyInfo() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/sbxtgl/reportInfo");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("addgovid",userDTO.getDepartid());
            modelAndView.addObject("jglevel",userDTO.getLevel());
            modelAndView.addObject("sendtime",DateUtil.getDate());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: SentenceController -----------------------------------

    /**
     * 基础信息--服刑信息添加
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termedit/view")
    public ModelAndView toSentence1(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("azbj/yazgl/inmates_sentence");
            mav.addObject("priNum",priNum);
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 基础信息--矫服刑信息添加
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/sj/termedit/view")
    public ModelAndView toSjSentence(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_sj_sentence");
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息修改
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditedit/view")
    public ModelAndView toSentenceInfoEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_sentenceedit");
            mav.addObject("prinum",prinum);
            // 山西个性化需求:将现刑期改为判决刑期
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息修改excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditedit/viewexcel")
    public ModelAndView toSentenceInfoEditExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_sentenceedit_excel");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            // 山西个性化需求:将现刑期改为判决刑期
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 在矫信息修改
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditsjedit/sjview")
    public ModelAndView toSjSentenceInfoEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_sj_sentenceedit");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息修改
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditBledit/view")
    public ModelAndView toBlSentenceInfoEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            String tuJing = baseInfoblService.findTuJing(prinum);
            String localCode = CodeUrlUtils.getLocalCode();
            if(Constants.NumberStr.NUM_STR_ZERO_TWO.equals(tuJing)) {
                mav = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_sentence_bljj");
            } else {
                mav = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_sentence_bl");
            }
            mav.addObject("localCode",localCode);
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditBlLook/view")
    public ModelAndView toBlSentenceInfoLook(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            String tuJing = baseInfoblService.findTuJing(prinum);
            if(Constants.NumberStr.NUM_STR_ZERO_TWO.equals(tuJing)) {
                mav = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_sentence_bljj");
            } else {
                mav = new ModelAndView("azbj/azbjgl/ryxxbl/inmates_sentence_bllook");
            }
            mav.addObject("priNum",JsonUtil.toText(prinum));
            mav.addObject("localCode",localCode);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 罪名列表
     * @param codeIds codeIds
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/inmates/sentence/zuiming")
    public ModelAndView toZuiMingListView(@RequestParam(required = false, defaultValue = "-1") String codeIds) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/zuiming-list");
            mav.addObject("codeIds",JsonUtil.toText(codeIds));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditlook/view")
    public ModelAndView toSentenceInfoLook(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_looksentence");
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(prinum);
            if(null != prisonerMain) {
                mav.addObject("pname",prisonerMain.getPName());
                mav.addObject("idnum",prisonerMain.getIdNum());
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            // 山西个性化需求: 现刑期改为判决刑期
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息查看excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditlook/viewexcel")
    public ModelAndView toSentenceInfoLookExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_looksentence_excel");
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(prinum);
            if(null != prisonerMain) {
                mav.addObject("pname",prisonerMain.getPName());
                mav.addObject("idnum",prisonerMain.getIdNum());
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            // 山西个性化需求: 现刑期改为判决刑期
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 在矫信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/inmates/termeditlook/sjview")
    public ModelAndView toSentenceSjInfoLook(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/inmates_sj_looksentence");
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(prinum);
            if(null != prisonerMain) {
                mav.addObject("pname",prisonerMain.getPName());
                mav.addObject("idnum",prisonerMain.getIdNum());
            }
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 职业列表
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/inmates/sentence/vocation")
    public ModelAndView toVocationListView() {
        return new ModelAndView("azbj/yazgl/vocation-list");
    }
    // ----------------------------------- todo: ShgxController -----------------------------------

    /**
     * 全部人员管理--新增--社会关系
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/qbrygl/addBaseInfo/view/toBjdxShgxTab")
    public ModelAndView toBjdxShgxTab(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/bjdxInfo/bjdxShgxTab");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: SjfxController -----------------------------------

    /**
     * 跳转 数据分析
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/tosjfx/view")
    public ModelAndView toSjfxView1() {
        ModelAndView mav;
        try {
            UserDTO user = userService.getAuthentication();
            mav = new ModelAndView("azbj/sjtjfx/sjfx/sjtjfx-sjfx");
            List<Map<String,String>> categoryList = allCensusService.getItemList("category",Constants.NumberStr.NUM_STR_ZERO,user);
            mav.addObject("categoryList",categoryList);
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 跳转 pstate数据状态分析-折线图版
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/sjztck/view")
    public ModelAndView toZySjztckView() {
        return new ModelAndView("azbj/sjtjfx/sjfx/sjtjfx-zy-sjztck");
    }

    /**
     * 跳转 pstate数据状态分析-表格版
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/sjztckTable/view")
    public ModelAndView toZySjztckTableView() {
        ModelAndView modelAndView = new ModelAndView("azbj/sjtjfx/sjfx/sjtjfx-zy-sjztck-table");
        //查看当前用户是否为管理员
        UserDTO userDTO = userService.getAuthentication();
        modelAndView.addObject("judgeManage", Constants.RoleId.ROLE_ID_AB.equals(userDTO.getRoleid())?"true":"false");
        return modelAndView;
    }

    /**
     * 跳转到新增定时SQL页面
     * @param flag 状态 1新增，2查看
     * @return modelAndView
     */
    @RequestMapping("/azbj/dsrw/regularCleanSql/addOrSelect/view")
    public ModelAndView addOrSelect(@RequestParam String flag) {
        ModelAndView modelAndView = new ModelAndView("azbj/dsrwxz/regularCleanSqlAddOrSelect");
        modelAndView.addObject("flag",flag);
        return modelAndView;
    }

    /**
     * 跳转到新增定时SQL页面
     * @return modelAndView
     */
    @RequestMapping("/azbj/dsrw/regularCleanSql/view")
    public ModelAndView toTimingSqlAddView() {
        ModelAndView modelAndView = new ModelAndView("azbj/dsrwxz/regularCleanSql");
        modelAndView.addObject("provinceArr",JsonUtil.toText(stringRedisTemplate.opsForHash().entries("province")));
        return modelAndView;
    }

    /**
     * 跳转接口对接日志页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/seelog/seejiekourizhi/view")
    public ModelAndView toJieKouLog() {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("/azbj/jiekouduijie/duijielog");
        }catch (Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }

    /**
     * 跳转接口对接页面的查看页面
     * @return modelAndView
     */
    @RequestMapping("/azbj/seelog/seejiekourizhi/seeview/view")
    public ModelAndView toJieKouLogSeeView(@RequestParam String id) {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("azbj/jiekouduijie/duijielogSeeView");
            modelAndView.addObject("id",id);
        }catch (Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }

    /**
     * 系统管理-运维管理-人员信息清理页面
     * @return
     */
    @RequestMapping("/azbj/ryql/view")
    public ModelAndView toRyqlLog() {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("/azbj/ryql/ryqlLog");
        }catch (Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }

    /**
     * 系统管理-运维管理-培训文件管理页面
     * @return
     */
    @RequestMapping("/azbj/spgl/view")
    public ModelAndView toSpglView() {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("/azbj/videoUpload/upload");
        }catch (Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }
    /**
     * 跳转到数据加密页面
     * @return modelAndView
     */
    @RequestMapping("/azbj/maintenance/dataEncryption/view")
    public ModelAndView toDataEncryptionView() {
        return new ModelAndView("azbj/yunwei/dataEncryption");
    }

    /**
     * 跳转页面查询页面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/maintenance/pageSelect/view")
    public ModelAndView toPageSelectView(){
        return new ModelAndView("azbj/yunwei/pageSelect");
    }

    /**
     * 跳转一键生成账号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/maintenance/generateAccount/view")
    public ModelAndView toGenerateAccountView(){
        return new ModelAndView("azbj/yunwei/generateAccount");
    }

    /**
     * 跳转一键生成账号，查看页面
     * @param serialNumber 编号
     * @return modelAndView
     */
    @RequestMapping("/azbj/dsrw/regularCleanSql/toGetAutoAccount/view")
    public ModelAndView toGetAutoAccount(@RequestParam String serialNumber) {
        ModelAndView modelAndView = new ModelAndView("azbj/yunwei/selectAutoAccount");
        modelAndView.addObject("map",maintenanceService.getAutoAccount(serialNumber));
        return modelAndView;
    }
    // ----------------------------------- todo: SlgInfoController -----------------------------------

    /**
     * 跳转到申请双列管页面
     * @param priNum priNum
     * @param id id
     * @param sex sex
     * @param pname pname
     * @param villid villid
     * @return ModelAndView
     */
    @RequestMapping("/azbjgl/slg/toapply/view")
    public ModelAndView toApplyView(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id,
            @RequestParam(required = false, defaultValue = "-1") String sex,
            @RequestParam(required = false, defaultValue = "-1") String pname,
            @RequestParam(required = false, defaultValue = "-1") String villid) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/azbjgl/slginfo/slg_apply");
            // 查询租房合同的数量 7
            Result result = uploadAppendixService.getCountById(priNum,id,Constants.AppendixFile.APDIX_FILE_SEVEN);
            // 查询工作合同的数量 8
            Result result1 = uploadAppendixService.getCountById(priNum,id,Constants.AppendixFile.APDIX_FILE_EIGHT);
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            mav.addObject("shenDate",format);
            mav.addObject("count",result.getData());
            mav.addObject("count1",result1.getData());
            mav.addObject("id",JsonUtil.toText(id));
            mav.addObject("priNum",JsonUtil.toText(priNum));
            mav.addObject("sex",sex);
            mav.addObject("villid",villid);
            mav.addObject("pname",JsonUtil.toText(pname));
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 跳转到双列管居住地审批界面
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbjgl/slg/approval/view")
    public ModelAndView toApprovalView(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/azbjgl/slginfo/slg_approval");
            mav.addObject("id",JsonUtil.toText(id));
            mav.addObject("priNum",JsonUtil.toText(priNum));
            mav.addObject("username",userService.getAuthentication().getUsername());
            mav.addObject("phone",userService.getAuthentication().getPhone());
            mav.addObject("telPhone",userService.getAuthentication().getTelphone());
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
        }
        return mav;
    }

    /**
     * 跳转到双列管详情页面
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbjgl/slg/details/view")
    public ModelAndView toDetailsPage(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/azbjgl/slginfo/slg_details");
            mav.addObject("priNum",priNum);
            mav.addObject("id",id);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转到解除双列管界面
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbjgl/slg/removeSlg/view")
    public ModelAndView toRemoveSlgView(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/azbjgl/slginfo/slg_remslg");
            //获取当前联系信息
            String username = userService.getAuthentication().getUsername();
            String phone = userService.getAuthentication().getPhone();
            String tel = userService.getAuthentication().getTelphone();
            mav.addObject("priNum",priNum);
            mav.addObject("id",id);
            mav.addObject("username",username);
            mav.addObject("phone",phone);
            mav.addObject("tel",tel);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 附件下载
     * @param request request
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @param nouploadflag nouploadflag
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfile/noupload/view")
    public ModelAndView uploadFile(HttpServletRequest request,
                                   @RequestParam String id,
                                   @RequestParam String priNum,
                                   @RequestParam String taskId,@RequestParam(required = false) String nouploadflag) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/azbjgl/slginfo/upload-appendix-file-noupload");
            // 一批文件公用id
            modelAndView.addObject("id",id);
            // 罪犯编号
            modelAndView.addObject("priNum",priNum);
            // 任务id 1：信息补录
            modelAndView.addObject("taskId",taskId);
            // 任务id 1：信息补录
            modelAndView.addObject("nouploadflag",nouploadflag);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: SlryglController -----------------------------------

    /**
     * 户籍迁入人员管理 - 审核页面 - 编辑
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/slrygl/toSldj/view")
    public ModelAndView toSldjTab() {
        ModelAndView mvc = new ModelAndView("/azbj/azbjgl/bjdxInfo/slrydj");
        String localCode = CodeUrlUtils.getLocalCode();
        mvc.addObject("localCode",localCode);
        return mvc;
    }

    /**
     * 户籍迁入人员管理--找回
     * @param slId slId
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/slrygl/toSlzh/view")
    public ModelAndView toSlzhTab(@RequestParam(required = false, defaultValue = "-1") String slId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/slryzh");
            // 山西个性化需求:失联事件改为人户分离时间
            String localCode = CodeUrlUtils.getLocalCode();
            mv.addObject("localCode",localCode);
            Result result = bjdxTuoguannfoService.getTuoguanInfoById(slId);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 户籍迁入人员管理--失联记录
     * @param slId slId
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/slrygl/toSljlViewTab")
    public ModelAndView toSljlViewTab(@RequestParam(required = false, defaultValue = "-1") String slId) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/slryjl");
            // 山西个性化需求:失联人员管理页面中去掉失联原因,失联时间修改为人户分离时间
            String localCode = CodeUrlUtils.getLocalCode();
            mv.addObject("localCode",localCode);
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
            }
            Result result = bjdxTuoguannfoService.getTuoguanJlInfoById(slId);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: SocialEmploymentController -----------------------------------

    /**
     * 跳转工作人员信息编辑页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/socialemployment/edit/{flog}")
    public ModelAndView toSocialEmploymentEdit(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/gzzygl/socialEmploymentInfo_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clabName",userDTO.getDepartName());
            modelAndView.addObject("adduserid",userDTO.getDepartid());
            modelAndView.addObject("addUserName",userDTO.getDepartName());
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: SocialOrganizeInfoController -----------------------------------

    /**
     * 跳转 社会关系信息增加
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/view")
    public ModelAndView toIndex10(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social-relations");
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 未成年子女信息添加
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/noadultadd/view")
    public ModelAndView toNoAdultAdd(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_noadultadd");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转到编辑界面
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/noadultedit/view")
    public ModelAndView toNoAdultEdit() {
        return new ModelAndView("azbj/yazgl/social_noadultedit");
    }

    /**
     * 跳转到编辑界面excel
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/noadultedit/viewexcel")
    public ModelAndView toNoAdultEditExcel() {
        return new ModelAndView("azbj/yazgl/social_noadultedit_excel");
    }

    /**
     * 跳转 新增-配偶、父母或其他信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/sr/view")
    public ModelAndView toSrView(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_sradd");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 编辑-配偶、父母或其他信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/sredit/view")
    public ModelAndView toSrViewEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_sredit");
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 编辑-配偶、父母或其他信息excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/sredit/viewexcel")
    public ModelAndView toSrViewEditExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_sredit_excel");
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社会关系信息增加
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relationsedit/view")
    public ModelAndView toSocialEdit(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social-relations-edit");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社会关系信息增加excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relationsedit/viewexcel")
    public ModelAndView toSocialEditExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social-relations-edit-excel");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社会关系信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relationslook/view")
    public ModelAndView toSocialLook(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social-relations-look");
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(prinum);
            mav.addObject("priNum",JsonUtil.toText(prinum));
            if(null != prisonerMain) {
                mav.addObject("pname",prisonerMain.getPName());
                mav.addObject("idnum",null != prisonerMain.getIdNum() ? prisonerMain.getIdNum() : "无");
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社会关系信息查看excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relationslook/viewexcel")
    public ModelAndView toSocialLookExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social-relations-look-excel");
            PrisonerMain prisonerMain = socialRelationsService.getPriMainByPrinum(prinum);
            mav.addObject("priNum",JsonUtil.toText(prinum));
            if(null != prisonerMain) {
                mav.addObject("pname",prisonerMain.getPName());
                mav.addObject("idnum",null != prisonerMain.getIdNum() ? prisonerMain.getIdNum() : "无");
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 查看-配偶、父母或其他信息
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/srlook/view")
    public ModelAndView toSrViewLook(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_looksr");
            mav.addObject("priNum",JsonUtil.toText(prinum));
            // 山西个性化需求: 监狱,社矫,看守所查看页面会高亮显示,代码块内容为山西个性化内容,其他省份可忽略
            {
                String localCode = CodeUrlUtils.getLocalCode();
                mav.addObject("localCode",localCode);
                if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                    UserDTO authentication = userService.getAuthentication();
                    Set<String> set = new HashSet<>();
                    if(StrUtil.containsEquals(authentication.getLevel(),Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)){
                        List<ChangeTable> changeTables = changeTableService.searchChangeTable(prinum, "prisoner_sr", null);
                        for (ChangeTable changeTable : changeTables) {
                            set.add(changeTable.getFieldName());
                        }
                    }
                    for (String field : set) {
                        mav.addObject(field,"true");
                    }
                }
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 查看-配偶、父母或其他信息excel
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/srlook/viewexcel")
    public ModelAndView toSrViewLookExcel(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/yazgl/social_looksr_excel");
            mav.addObject("priNum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 未成年子女信息查看
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/noadultlook/view")
    public ModelAndView toNoAdultLook(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mav = new ModelAndView("azbj/yazgl/social_looknoadult");
        // 山西个性化需求: 监狱,社矫,看守所查看页面会高亮显示,代码块内容为山西个性化内容,其他省份可忽略
        {
            String localCode = CodeUrlUtils.getLocalCode();
            mav.addObject("localCode",localCode);
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                UserDTO authentication = userService.getAuthentication();
                Set<String> set = new HashSet<>();
                if(StrUtil.containsEquals(authentication.getLevel(),Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)){
                    List<ChangeTable> changeTables = changeTableService.searchChangeTable(priNum, "prisoner_zn", null);
                    for (ChangeTable changeTable : changeTables) {
                        set.add(changeTable.getFieldName());
                    }
                }
                for (String field : set) {
                    mav.addObject(field,"true");
                }
            }
        }
        return mav;
    }

    /**
     * 跳转 未成年子女信息查看excel
     * @return ModelAndView
     */
    @RequestMapping("/azbj/social-relations/noadultlook/viewexcel")
    public ModelAndView toNoAdultLookExcel() {
        return new ModelAndView("azbj/yazgl/social_looknoadult_excel");
    }

    /**
     * 跳转工作人员信息编辑页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/shzzgl/socialOrgInfo/edit/{flog}")
    public ModelAndView toSocialOrgInfoEdit(@PathVariable String flog) {
        ModelAndView modelAndView = new ModelAndView("azbj/shzzgl/socialOrganizeInfo_edit");
        modelAndView.addObject("flog",flog);
        return modelAndView;
    }
    // ----------------------------------- todo: SocialTrainingController -----------------------------------

    /**
     * 机构人员信息管理
     * 安帮工作人员信息管理
     * 志愿者信息管理
     * 安帮基地信息管理
     * 就业岗位信息管理
     * 就业培训机构管理
     * 政府救助帮扶信息管理
     * 安帮社会组织信息管理 -- 公共列表
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/azbj/socialtraining/infoList/view")
    public ModelAndView toIndex11(@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/gzzygl/list_shjygl");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
                modelAndView.addObject("createUser",userDTO.getAccount());
                modelAndView.addObject("clab",userDTO.getDepartid());
                modelAndView.addObject("clab_name",userDTO.getDepartName());
            }
            // 山西个性化需求:增加启用/禁用功能
            {
                String localCode = CodeUrlUtils.getLocalCode();
                modelAndView.addObject("localCode",localCode);
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转工作人员信息编辑页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/socialtraining/edit/{flog}")
    public ModelAndView toSocialTrainingEdit(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/gzzygl/socialTrainingInfo_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("clab",userDTO.getDepartid());
            modelAndView.addObject("clabName",userDTO.getDepartName());
            modelAndView.addObject("adduserid",userDTO.getDepartid());
            modelAndView.addObject("addUserName",userDTO.getDepartName());
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: SolrSearchController -----------------------------------

    /**
     * 跳转 多维数据搜索页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/search/view")
    public ModelAndView toSearchView(HttpServletRequest request) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("azbj/search/searchView");
            String loginUserDepartId = userService.getAuthentication().getDepartid();
            //获取省份信息
            Result result = advanSearchService.getProvince(loginUserDepartId);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 跳转 高级检索页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/search/advancedView")
    public ModelAndView toAdvancedView(HttpServletRequest request) {
        return new ModelAndView("azbj/search/advancedView");
    }
    // ----------------------------------- todo: SqjzController -----------------------------------

    /**
     * 社矫--职业技能tab页面
     * 注意：与监狱共用后台查询逻辑，页面不同，修改SQL时需注意，如社矫有需要单独拆分开来
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/xxbl/zyjn/tab")
    public ModelAndView toZyjnTab1(HttpServletRequest request) {
        ModelAndView mav;
        try {
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            //服刑人员编号
            String priNum = (String)params.get("priNum");
            //职业技能tab页面
            mav = new ModelAndView("/azbj/sqjz/sqjz_zyjn_tab");
            mav.addObject("priNum",priNum);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 社矫--危险性评估tab页面
     * 注意：与监狱共用后台查询逻辑，页面不同，修改SQL时需注意，如社矫有需要单独拆分开来
     * @param request request
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/xxbl/wxxpg/tab")
    public ModelAndView toSqzjWxxpgTab(HttpServletRequest request,@RequestParam(required = false) String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("/azbj/sqjz/sqjz_wxxpg_tab");
            if(StringUtils.isEmpty(prinum)) {
                return mav;
            }
            //查询该罪犯出监评估信息
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum(prinum);
            Map<String,Object> cjpgInfoMap = JsonUtil.toMap(cjpgInfo);
            //危险性评估信息
            String map = sentenceService.getSenInfoById(prinum);
            if(Constants.NumberStr.NUM_STR_FU_ONE.equals(map)) {
                mav.addObject("priNum",prinum);
                //表示该罪犯未保存服刑信息
                mav.addObject("fxFlag",Constants.NumberStr.NUM_STR_ZERO);
                return mav;
            }
            Map<String,Object> jsonMap = JsonUtil.toMap(map);
            mav.addObject("priNum",prinum);
            mav.addObject("id",ObjectUtils.isEmpty(jsonMap.get("id")) ? null : jsonMap.get("id"));
            mav.addObject("amnesty","".equals(jsonMap.get("amnesty")) ? null : jsonMap.get("amnesty"));
            mav.addObject("zfz","".equals(jsonMap.get("zfz")) ? null : jsonMap.get("zfz"));
            mav.addObject("death","".equals(jsonMap.get("death")) ? null : jsonMap.get("death"));
            mav.addObject("zrsqjz","".equals(jsonMap.get("zrsqjz")) ? null : jsonMap.get("zrsqjz"));
            mav.addObject("sanwu",jsonMap.get("sanwu"));
            mav.addObject("sanjia",jsonMap.get("sanjia"));
            mav.addObject("wujia",jsonMap.get("wujia"));
            mav.addObject("wuqin",jsonMap.get("wuqin"));
            mav.addObject("wuye",jsonMap.get("wuye"));
            mav.addObject("jxm",jsonMap.get("jxm"));
            mav.addObject("jsf",jsonMap.get("jsf"));
            mav.addObject("jhj",jsonMap.get("jhj"));
            mav.addObject("wushe",jsonMap.get("wushe"));
            mav.addObject("sishi",jsonMap.get("sishi"));
            mav.addObject("shekong",jsonMap.get("shekong"));
            mav.addObject("shexie",jsonMap.get("shexie"));
            mav.addObject("shedu",jsonMap.get("shedu"));
            mav.addObject("sheqiang",jsonMap.get("sheqiang"));
            mav.addObject("shehei",jsonMap.get("shehei"));
            mav.addObject("xijing",jsonMap.get("xijing"));
            mav.addObject("taotuo",jsonMap.get("taotuo"));
            mav.addObject("drughis",jsonMap.get("drughis"));
            mav.addObject("zisha",jsonMap.get("zisha"));
            mav.addObject("gaizao",jsonMap.get("gaizao"));
            mav.addObject("renzui",jsonMap.get("renzui"));
            mav.addObject("xinli",jsonMap.get("xinli"));
            mav.addObject("lianxi",jsonMap.get("lianxi"));
            mav.addObject("baowaijiuyi","".equals(jsonMap.get("baowaijiuyi")) ? null : jsonMap.get("baowaijiuyi"));
            mav.addObject("pinggu",jsonMap.get("pinggu"));
            mav.addObject("weifa",jsonMap.get("weifa"));
            mav.addObject("canji",jsonMap.get("canji"));
            mav.addObject("Aftype",jsonMap.get("Aftype"));
            mav.addObject("localCode",localCode);
            if(null != cjpgInfoMap) {
                mav.addObject("canji",cjpgInfoMap.get("canji"));
                mav.addObject("gdzs",cjpgInfoMap.get("gdzs"));
                mav.addObject("shjw",cjpgInfoMap.get("shjw"));
                mav.addObject("jtbh",cjpgInfoMap.get("jtbh"));
                mav.addObject("baowaijiuyi",cjpgInfoMap.get("baowaijiuyi"));
                mav.addObject("xshkn",cjpgInfoMap.get("xshkn"));
                mav.addObject("jiuzhujianyi",cjpgInfoMap.get("jiuzhujianyi"));
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社矫人员核查——查看
     * @param priNum priNum
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/baseinfo/tolookview")
    public ModelAndView toLookBaseinfoview1(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/sqjz/sqjz_baseinfo_looktabs");
            mav.addObject("prinum",JsonUtil.toText(priNum));
            mav.addObject("id",JsonUtil.toText(id));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 基本信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/baseinfolook/view")
    public ModelAndView toBaseinfolookView1(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_inmates_looktabs");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 服刑信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/termeditlook/view")
    public ModelAndView toSentenceInfoLook1(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_inmates_looksentence");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转 社会关系信息查看
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/social-relationslook/view")
    public ModelAndView toSocialLook1(@RequestParam(required = false, defaultValue = "-1") String prinum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_social_relations_look");
            mav.addObject("prinum",JsonUtil.toText(prinum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 社矫--职业技能查看页面
     * 注意：与监狱共用后台查询逻辑，页面不同，修改SQL时需注意，如社矫有需要单独拆分开来
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/xxbl/zyjnlook/tab")
    public ModelAndView toZyjnTabLook(HttpServletRequest request) {
        ModelAndView mav;
        try {
            Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
            //服刑人员编号
            String priNum = (String)params.get("priNum");
            //职业技能tab页面
            mav = new ModelAndView("/azbj/sqjz/sqjz_zyjn_look");
            mav.addObject("priNum",priNum);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 社矫--危险性评估查看页面
     * 注意：与监狱共用后台查询逻辑，页面不同，修改SQL时需注意，如社矫有需要单独拆分开来
     * @param request request
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/xxbl/wxxpglook/tab")
    public ModelAndView toSqzjWxxpgTabLook(HttpServletRequest request,@RequestParam(required = false) String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("/azbj/sqjz/sqjz_wxxpg_look");
            if(StringUtils.isEmpty(prinum)) {
                return mav;
            }
            //查询该罪犯出监评估信息
            //查询上传附件的数量
            Result result1 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FOUR);
            Result result2 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FIVE);
            Result result3 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_ONE);
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum(prinum);
            Map<String,Object> cjpgInfoMap = JsonUtil.toMap(cjpgInfo);
            //危险性评估信息
            String map = sentenceService.getSenInfoById(prinum);
            if(Constants.NumberStr.NUM_STR_FU_ONE.equals(map)) {
                mav.addObject("priNum",prinum);
                //表示该罪犯未保存服刑信息
                mav.addObject("fxFlag",Constants.NumberStr.NUM_STR_ZERO);
                return mav;
            }
            Map<String,Object> jsonMap = JsonUtil.toMap(map);
            mav.addObject("count1",result1.getData());
            mav.addObject("count2",result2.getData());
            mav.addObject("count3",result3.getData());
            mav.addObject("priNum",prinum);
            mav.addObject("id",ObjectUtils.isEmpty(jsonMap.get("id")) ? null : jsonMap.get("id"));
            mav.addObject("amnesty","".equals(jsonMap.get("amnesty")) ? null : jsonMap.get("amnesty"));
            mav.addObject("zfz","".equals(jsonMap.get("zfz")) ? null : jsonMap.get("zfz"));
            mav.addObject("death","".equals(jsonMap.get("death")) ? null : jsonMap.get("death"));
            mav.addObject("zrsqjz","".equals(jsonMap.get("zrsqjz")) ? null : jsonMap.get("zrsqjz"));
            mav.addObject("sanwu",jsonMap.get("sanwu"));
            mav.addObject("sanjia",jsonMap.get("sanjia"));
            mav.addObject("wujia",jsonMap.get("wujia"));
            mav.addObject("wuqin",jsonMap.get("wuqin"));
            mav.addObject("wuye",jsonMap.get("wuye"));
            mav.addObject("jxm",jsonMap.get("jxm"));
            mav.addObject("jsf",jsonMap.get("jsf"));
            mav.addObject("jhj",jsonMap.get("jhj"));
            mav.addObject("wushe",jsonMap.get("wushe"));
            mav.addObject("sishi",jsonMap.get("sishi"));
            mav.addObject("shekong",jsonMap.get("shekong"));
            mav.addObject("shexie",jsonMap.get("shexie"));
            mav.addObject("shedu",jsonMap.get("shedu"));
            mav.addObject("sheqiang",jsonMap.get("sheqiang"));
            mav.addObject("shehei",jsonMap.get("shehei"));
            mav.addObject("xijing",jsonMap.get("xijing"));
            mav.addObject("taotuo",jsonMap.get("taotuo"));
            mav.addObject("drughis",jsonMap.get("drughis"));
            mav.addObject("zisha",jsonMap.get("zisha"));
            mav.addObject("gaizao",jsonMap.get("gaizao"));
            mav.addObject("renzui",jsonMap.get("renzui"));
            mav.addObject("xinli",jsonMap.get("xinli"));
            mav.addObject("lianxi",jsonMap.get("lianxi"));
            mav.addObject("baowaijiuyi","".equals(jsonMap.get("baowaijiuyi")) ? null : jsonMap.get("baowaijiuyi"));
            mav.addObject("pinggu",jsonMap.get("pinggu"));
            mav.addObject("weifa",jsonMap.get("weifa"));
            mav.addObject("canji",jsonMap.get("canji"));
            mav.addObject("Aftype",jsonMap.get("Aftype"));
            mav.addObject("localCode",localCode);
            if(null != cjpgInfoMap) {
                mav.addObject("canji",cjpgInfoMap.get("canji"));
                mav.addObject("gdzs",cjpgInfoMap.get("gdzs"));
                mav.addObject("shjw",cjpgInfoMap.get("shjw"));
                mav.addObject("jtbh",cjpgInfoMap.get("jtbh"));
                mav.addObject("baowaijiuyi",cjpgInfoMap.get("baowaijiuyi"));
                mav.addObject("xshkn",cjpgInfoMap.get("xshkn"));
                mav.addObject("jiuzhujianyi",cjpgInfoMap.get("jiuzhujianyi"));
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }
    // ----------------------------------- todo: StaffInfoManageController -----------------------------------

    /**
     * 跳转工作人员信息编辑页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/gzzygl/staffInfoManage/edit/{flog}")
    public ModelAndView toStaffInfoManageEdit(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/gzzygl/staffInfoManage_edit");
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: StatisticalReportsController -----------------------------------

    /**
     * 跳转 统计分析报表
     * @return ModelAndView
     */
    @RequestMapping("/azbj/statisticalreports/fxbb/view")
    public ModelAndView toFxbbView() {
        ModelAndView modelAndView;
        try {
            String level = userService.getAuthentication().getLevel();
            String localCode = CodeUrlUtils.getLocalCode();
            if(StringUtils.equals(Constants.OrgLevel.LEVEL_JY,level) || StringUtils.equals(Constants.OrgLevel.LEVEL_JYJ,level)) {
                modelAndView = new ModelAndView("azbj/sjtjfx/fxbb/tjfxbb-jy");
            } else {
                modelAndView = new ModelAndView("azbj/sjtjfx/fxbb/tjfxbb-sf");
            }
            modelAndView.addObject("level",level);
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 数据统计分析 - 数据指标统计
     * @return ModelAndView
     */
    @RequestMapping("/azbj/statisticalreports/bdzb/view")
    public ModelAndView toBdView() {
        ModelAndView modelAndView;
        try {
            String level = userService.getAuthentication().getLevel();
            if(StringUtils.equals(Constants.OrgLevel.LEVEL_JY,level) || StringUtils.equals(Constants.OrgLevel.LEVEL_JYJ,level)) {
                modelAndView = new ModelAndView("azbj/sjtjfx/bd/bd-jy");
            } else {
                modelAndView = new ModelAndView("azbj/sjtjfx/bd/bd-sf");
            }
            modelAndView.addObject("level",level);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: UploadAppendixFileController -----------------------------------

    /**
     * 上传附件页面(只能上传图片格式的文件)
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfileimg/view")
    public ModelAndView uploadFileImg(@RequestParam String id,@RequestParam String priNum,@RequestParam String taskId, @RequestParam(required = false) Boolean look) {
        ModelAndView modelAndView = new ModelAndView("azbj/uploadappendix/upload-appendix-file-img");
        // 一批文件公用id
        modelAndView.addObject("id",id);
        // 罪犯编号
        modelAndView.addObject("priNum",priNum);
        // 任务id 1：信息补录
        modelAndView.addObject("taskId",taskId);
        //查看标识 true-是 false-否
        if(null == look) {
            look = false;
        }
        modelAndView.addObject("look",look);
        return modelAndView;
    }

    /**
     * 上传附件页面
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @param look 是否是查看 -- 查看附件的话不允许进行上传文件
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfile/view")
    public ModelAndView uploadFile(@RequestParam String id,@RequestParam String priNum,@RequestParam String taskId ,@RequestParam(required = false) Boolean look) {
        ModelAndView modelAndView = new ModelAndView("azbj/uploadappendix/upload-appendix-file");
        // 一批文件公用id
        modelAndView.addObject("id",id);
        // 罪犯编号
        modelAndView.addObject("priNum",priNum);
        // 任务id 1：信息补录
        modelAndView.addObject("taskId",taskId);
        //是否查看
        modelAndView.addObject("look",look);
        return modelAndView;
    }

    /**
     * 查看下载附件
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfile/see")
    public ModelAndView uploadiew(
            @RequestParam String id,@RequestParam String priNum,@RequestParam String taskId) {
        ModelAndView modelAndView = new ModelAndView("azbj/uploadappendix/upload-appendix-file-view");
        // 一批文件公用id
        modelAndView.addObject("id",id);
        // 罪犯编号
        modelAndView.addObject("priNum",priNum);
        // 任务id 1：信息补录
        modelAndView.addObject("taskId",taskId);
        return modelAndView;
    }

    /**
     * 只做文件查询下载
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @param nouploadflag nouploadflag
     * @return ModelAndView
     */
    @GetMapping("/upload/user/queryAppendixfile/view")
    public ModelAndView queryFile(
            @RequestParam String id,
            @RequestParam String priNum,
            @RequestParam String taskId,@RequestParam(required = false) String nouploadflag) {
        ModelAndView modelAndView = new ModelAndView("azbj/uploadappendix/query-appendix-file");
        // 一批文件公用id
        modelAndView.addObject("id",id);
        // 罪犯编号
        modelAndView.addObject("priNum",priNum);
        // 任务id 1：信息补录
        modelAndView.addObject("taskId",taskId);
        //不显示上传按钮标记
        modelAndView.addObject("nouploadflag",nouploadflag);
        return modelAndView;
    }

    /**
     * 二次衔接上传页面
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @param nouploadflag nouploadflag
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfileSecXj/view")
    public ModelAndView uploadFileToSecXj(
            @RequestParam String id,
            @RequestParam String priNum,
            @RequestParam String taskId,@RequestParam(required = false) String nouploadflag) {
        UserDTO user = userService.getAuthentication();
        ModelAndView modelAndView = new ModelAndView("azbj/uploadappendix/upload-appendix-file-secxj");
        // 一批文件公用id
        modelAndView.addObject("id",id);
        // 罪犯编号
        modelAndView.addObject("priNum",priNum);
        // 任务id 1：信息补录
        modelAndView.addObject("taskId",taskId);
        modelAndView.addObject("level",user.getLevel());
        //标记不显示上传按钮
        modelAndView.addObject("nouploadflag",nouploadflag);
        return modelAndView;
    }
    // ----------------------------------- todo: UploadFileTemplateController -----------------------------------

    /**
     * 数据统计分析--模板管理--新增
     * @param id id
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sjtjfx/scbg/uploadtemplate/view")
    public ModelAndView toAbSetTabs(
            @RequestParam(required = false, defaultValue = "-1") String id,HttpServletRequest request) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/sjtjfx/bgsc/uploadFileTemplate");
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                mv.addObject("id",id);
                Result result = uploadFileTemplateService.getTemplateInfoById(id);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    Map<String,Object> map = (Map<String,Object>)result.getData();
                    mv.addAllObjects(map);
                }
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }
    // ----------------------------------- todo: VerificationController -----------------------------------

    /**
     * 核查中-控制按钮的列表
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/resettlemanage/hcxx/view")
    public ModelAndView toHcxxPublicListPag(@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/list-zxhc");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                modelAndView.addAllObjects(data);
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转发起核查页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-first/view")
    public ModelAndView toVerificationFirst(HttpServletRequest request) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-first");
            String prinum = request.getParameter("prinum");
            Integer isAll = sentenceService.getIsAll(prinum);
            boolean flag = (null == isAll || Constants.Number.NUM_ZERO >= isAll) && (prinum.contains(Constants.OldDataFlag.A_FLAG) || prinum.contains(Constants.OldDataFlag.B_FLAG));
            if(flag) {
                return new ModelAndView("/error/polise_hc_error");
            }
            UserDTO authentication = userService.getAuthentication();
            List<Map<String,Object>> hcList = verificationService.getPrisonerHcListByPriNum(prinum);
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            paramMap.put("isPlhc","false");
            //处理死缓、死刑、无期显示
            if(Constants.StrFinalValue.UNDEFINED.equals(paramMap.get(Constants.StrFinalValue.CJDATE))) {
                paramMap.put("cjDate","");
            }
            if(CollectionUtils.isNotEmpty(hcList)) {
                paramMap.put("startCheckPerson",authentication.getUsername());
                if(null != hcList.get(0)) {
                    paramMap.put("startCheckTime",hcList.get(0).get("startCheckTime"));
                    paramMap.put("startCheckTel",hcList.get(0).get("startCheckTel"));
                }
                paramMap.put("startCheckPhone",authentication.getPhone());
            } else {
                paramMap.put("startCheckPerson",authentication.getUsername());
                paramMap.put("startCheckTime","");
                paramMap.put("startCheckTel",authentication.getTelphone());
                paramMap.put("startCheckPhone",authentication.getPhone());
            }
            //根据户籍街道信息查询是否有对应的司法所存在，用于发起核查校验
            PrisonerMain prisonerMain = verificationService.getPrisonerMainByPriNum(prinum);
            Result result = verificationService.selectUserByNativevill(prisonerMain);
            paramMap.put("checkUser",result);
            modelAndView.addObject("paramMap",paramMap);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转批量发起核查页面
     * @param request request
     * @param prinums prinums
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-first/plview")
    public ModelAndView plview1(HttpServletRequest request,@RequestParam String... prinums) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-first");
            Map<String,Object> paramMap = ConvertHttpToMap.getParameterMap(request);
            paramMap.put("isPlhc","true");
            paramMap.put("startCheckPerson","");
            paramMap.put("startCheckTime","");
            paramMap.put("startCheckTel","");
            paramMap.put("startCheckPhone","");
            StringBuilder stringBuilder = new StringBuilder(16);
            for(String prinum : prinums) {
                stringBuilder.append(prinum).append("|");
            }
            paramMap.put("prinum",stringBuilder.toString());
            modelAndView.addObject("paramMap",paramMap);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 执行核查
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxhc/view")
    public ModelAndView toZxhc(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxhc");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            String failurenum = (String)prisonerHc.get("failurenum");
            modelAndView.addObject("failurenum",failurenum);
            UserDTO authentication = userService.getAuthentication();
            String username = authentication.getDepartName();
            String phone = authentication.getPhone();
            String telphone = authentication.getTelphone();
            String conmectuserTelphone = (String)prisonerHc.get("conmectuserTelphone");
            String conmectuserPhone = (String)prisonerHc.get("conmectuserPhone");
            String conmectuserName = (String)prisonerHc.get("conmectuserName");
            List<HashMap<String,String>> data = new ArrayList<>();
            String hcId = (String)prisonerHc.get("id");
            Result result = prisonerTransferService.getBaseInfoByPriNum(hcId);
            if(null != result.getData() && Constants.Number.NUM_ONE.equals(result.getCode())) {
                if((result.getData() instanceof List)) {
                    data = (List<HashMap<String,String>>)result.getData();
                }
            }
            Iterator<HashMap<String,String>> iterator = data.iterator();
            while(iterator.hasNext()) {
                HashMap<String,String> next = iterator.next();
                if(null != next) {
                    String level1 = next.get("level");
                    String priReason = next.get("priReason");
                    if(Constants.OrgLevel.LEVEL_QXSFJ.equals(level1)) {
                        modelAndView.addObject("qxsfjReason",priReason);
                    } else if(Constants.OrgLevel.LEVEL_DSSFJ.equals(level1)) {
                        modelAndView.addObject("dssfjReason",priReason);
                    } else if(Constants.OrgLevel.LEVEL_SFT.equals(level1)) {
                        modelAndView.addObject("sftReason",priReason);
                    }
                }
            }
            modelAndView.addObject("prisonerHc",prisonerHc);
            if(StringUtils.isNotEmpty(conmectuserTelphone)) {
                modelAndView.addObject("conmectuserTelphone",conmectuserTelphone);
            } else if(StringUtils.isEmpty(conmectuserTelphone)) {
                modelAndView.addObject("conmectuserTelphone",telphone);
            }
            if(StringUtils.isNotEmpty(conmectuserPhone)) {
                modelAndView.addObject("conmectuserPhone",conmectuserPhone);
            } else if(StringUtils.isEmpty(conmectuserPhone)) {
                modelAndView.addObject("conmectuserPhone",phone);
            }
            if(StringUtils.isNotEmpty(conmectuserName)) {
                modelAndView.addObject("conmectuserName",conmectuserName);
            } else if(StringUtils.isBlank(conmectuserName)) {
                modelAndView.addObject("conmectuserName",username);
            }
            // 山西个性化功能,将居住地改为日常居住地
            {
                String localCode = CodeUrlUtils.getLocalCode();
                modelAndView.addObject("localCode",localCode);
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 司法局对没有街道数据的待核查数据进行数据补全
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxjy/view")
    public ModelAndView toZxjy(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxjy");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            modelAndView.addObject("prisonerHc",prisonerHc);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 司法局根据司法厅比对结果，更改户籍地址，推送到司法所核查
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxjyts/view")
    public ModelAndView toZxjyts(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxjyts");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            modelAndView.addObject("prisonerHc",prisonerHc);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转司法所对查不清户籍人员接收页面
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxhc-js/view")
    public ModelAndView toZxhcJs(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxhc-js");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            UserDTO authentication = userService.getAuthentication();
            modelAndView.addObject("startCheckPerson",authentication.getUsername());
            modelAndView.addObject("startCheckPhone",authentication.getPhone());
            modelAndView.addObject("startCheckTelPhone",authentication.getTelphone());
            modelAndView.addObject("prisonerHc",prisonerHc);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 核查失败的展示页面
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-hcsb/view")
    public ModelAndView toHcsb(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-hcsb");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            //conmectuserPhone为核查人的号码，规则  手机号|固定号码
            if(null != prisonerHc.get(Constants.StrFinalValue.CONMECTUSERPHONE)) {
                String conmectuserPhone = prisonerHc.get("conmectuserPhone").toString();
                if(conmectuserPhone.contains(Constants.SpecialChar.NUM_CHAR_E)) {
                    String phone = conmectuserPhone.substring(0,conmectuserPhone.indexOf('|'));
                    prisonerHc.put("conmectuserPhone",phone);
                    String telPhone = conmectuserPhone.substring(conmectuserPhone.indexOf('|') + 1);
                    prisonerHc.put("conmectuserTelphone",telPhone);
                } else {
                    prisonerHc.put("conmectuserPhone",conmectuserPhone);
                }
            }
            modelAndView.addObject("prisonerHc",prisonerHc);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 预安置管理 - 预安置人员核查 - 待办工作 - 办理
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-handle/view")
    public ModelAndView toTuiSong(String id,String pstate) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-handle");
            PrisonerMainAndHcVo vo = verificationService.getPrisonerMainAndHcVoById(id);
            UserDTO userDTO = userService.getAuthentication();
            vo.setPushName(userDTO.getUsername());
            vo.setPhoneNumber(userDTO.getPhone());
            vo.setFixedLineNumber(userDTO.getTelphone());
            modelAndView.addObject("pstate",pstate);
            modelAndView.addObject("prisonerHc",vo);
            String level = userDTO.getLevel();
            modelAndView.addObject("level",level);
            // 司法厅,地市司法局,区县司法局
            if(StrUtil.containsEquals(level,Constants.OrgLevel.LEVEL_SFT,Constants.OrgLevel.LEVEL_DSSFJ,Constants.OrgLevel.LEVEL_QXSFJ)) {
                List<HashMap<String,String>> data = new ArrayList<>();
                Result result = prisonerTransferService.getBaseInfoByPriNum(id);
                if(null != result.getData() && Constants.Number.NUM_ONE.equals(result.getCode())) {
                    if((result.getData() instanceof List)) {
                        data = (List<HashMap<String,String>>)result.getData();
                    }
                }
                Iterator<HashMap<String,String>> iterator = data.iterator();
                while(iterator.hasNext()) {
                    HashMap<String,String> next = iterator.next();
                    if(null != next) {
                        String level1 = next.get("level");
                        String priReason = next.get("priReason");
                        if(Constants.OrgLevel.LEVEL_QXSFJ.equals(level1)) {
                            modelAndView.addObject("qxsfjReason",priReason);
                        } else if(Constants.OrgLevel.LEVEL_DSSFJ.equals(level1)) {
                            modelAndView.addObject("dssfjReason",priReason);
                        } else if(Constants.OrgLevel.LEVEL_SFT.equals(level1)) {
                            modelAndView.addObject("sftReason",priReason);
                        }
                    }
                }
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 执行比对
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxbd/view")
    public ModelAndView toZxbd(String id) {
        ModelAndView modelAndView;
        try {
            UserDTO authentication = userService.getAuthentication();
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxbd");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            modelAndView.addObject("prisonerHc",prisonerHc);
            modelAndView.addObject("authentication",authentication);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 执行比对
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zxbdsfj/view")
    public ModelAndView toZxbdSfj(String id) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zxbdsfj");
            Map<String,Object> prisonerHc = verificationService.getPrisonerHcById(id);
            modelAndView.addObject("prisonerHc",prisonerHc);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 二次核查失败转入原侦查机关
     * @param prinum prinum
     * @param nativepro nativepro
     * @param nativecity nativecity
     * @param nativecou nativecou
     * @param nativevill nativevill
     * @param nativenum nativenum
     * @param failurenum failurenum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zryzcjg/view")
    public ModelAndView toZryzcjg(String prinum,String nativepro,String nativecity,String nativecou,String nativevill,String nativenum,String failurenum) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zryzcjg");
            UserDTO authentication = userService.getAuthentication();
            // 根据罪犯编号查服刑信息
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd H:mm:ss");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            // 根据罪犯编号查找核查信息
            Result result = verificationService.getPrisonerHcByPriNum(prinum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                HashMap<String,String> data = (HashMap<String,String>)result.getData();
                modelAndView.addObject("sftsbyy",data.get("priReason"));
            }
            modelAndView.addObject("startCheckPerson",authentication.getUsername());
            modelAndView.addObject("startCheckPhone",authentication.getPhone());
            modelAndView.addObject("startCheckTel",authentication.getTelphone());
            modelAndView.addObject("startCheckTime",format);
            modelAndView.addObject("nativepro",nativepro);
            modelAndView.addObject("nativecity",nativecity);
            modelAndView.addObject("nativecou",nativecou);
            modelAndView.addObject("nativevill",nativevill);
            modelAndView.addObject("nativenum",nativenum);
            modelAndView.addObject("prinum",prinum);
            modelAndView.addObject("failurenum",failurenum);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 预安置人员 - 预安置人员核查 - 核查失败 - 再次发起核查
     * @param prinum prinum
     * @param nativepro nativepro
     * @param nativecity nativecity
     * @param nativecou nativecou
     * @param nativevill nativevill
     * @param nativenum nativenum
     * @param failurenum failurenum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/verification-zcfqhc/view")
    public ModelAndView toZcfqhc(String prinum,String nativepro,String nativecity,String nativecou,String nativevill,String nativenum,String failurenum,String sex) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("/azbj/yazgl/verification/verification-zcfqhc");
            UserDTO authentication = userService.getAuthentication();
            // 根据罪犯编号查找核查信息
            Result result = verificationService.getPrisonerHcByPriNum(prinum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                HashMap<String,String> data = (HashMap<String,String>)result.getData();
                modelAndView.addObject("sftsbyy",data.get("priReason"));
            }
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd H:mm:ss");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            modelAndView.addObject("startCheckPerson",authentication.getUsername());
            modelAndView.addObject("startCheckPhone",authentication.getPhone());
            modelAndView.addObject("startCheckTel",authentication.getTelphone());
            modelAndView.addObject("startCheckTime",format);
            modelAndView.addObject("nativepro",nativepro);
            modelAndView.addObject("nativecity",nativecity);
            modelAndView.addObject("nativecou",nativecou);
            modelAndView.addObject("nativevill",nativevill);
            modelAndView.addObject("nativenum",nativenum);
            modelAndView.addObject("prinum",prinum);
            modelAndView.addObject("failurenum",failurenum);
            modelAndView.addObject("sex",sex);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: VolunteerManageController -----------------------------------

    /**
     * 跳转新增页面
     * @param flog flog
     * @return ModelAndView
     */
    @RequestMapping("/azbj/zyzxxgl/volunteerInfoManage/view/{flog}")
    public ModelAndView toIndex12(@PathVariable String flog) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("azbj/zyzxxgl/volunteerManage_edit");
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("adduserid",userDTO.getDepartid());
            modelAndView.addObject("addusername",userDTO.getDepartName());
            modelAndView.addObject("departid",userDTO.getDepartid());
            modelAndView.addObject("level",userDTO.getLevel());
            modelAndView.addObject("flog",flog);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: WorkCoordinationController -----------------------------------

    /**
     * 业务协调上报界面
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ksywxt/apply")
    public ModelAndView toApplyPage(@RequestParam(defaultValue = "-1", required = false) String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/ksywxt/workCoordination_apply");
            UserDTO user = userService.getAuthentication();
            // 查询司法厅回复中文件的数量
            Result result1 = uploadAppendixService.getCountAll(priNum,"35");
            String localProvinceCode = user.getDepartid().substring(0,2) + "0000";
            String localProvinceName = commonService.getCodeNameByCode(localProvinceCode);
            String interProBusiness = workCoordinationService.getInterProvincialBusinessInfo(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(interProBusiness);
            mav.addObject("resultMap",resultMap);
            mav.addObject("provinceCode",localProvinceCode);
            mav.addObject("provinceName",localProvinceName);
            mav.addObject("count1",result1.getData());
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转第三司法厅处理协调页面
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ksywxt/deal")
    public ModelAndView toDealPage(@RequestParam(defaultValue = "-1", required = false) String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/ksywxt/workCoordination_deal");
            UserDTO user = userService.getAuthentication();
            String localProvinceCode = user.getDepartid().substring(0,2) + "0000";
            String localProvinceName = commonService.getCodeNameByCode(localProvinceCode);
            String interProBusiness = workCoordinationService.getInterProvincialBusinessInfo(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(interProBusiness);
            mav.addObject("resultMap",resultMap);
            mav.addObject("provinceCode",localProvinceCode);
            mav.addObject("provinceName",localProvinceName);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转第三司法厅处理协调页面
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ksywxt/toDealOrigin")
    public ModelAndView toDealOriginPage(@RequestParam(defaultValue = "-1", required = false) String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("/azbj/azbjgl/ksywxt/workCoordination_deal_origin");
            UserDTO user = userService.getAuthentication();
            String localProvinceCode = user.getDepartid().substring(0,2) + "0000";
            String localProvinceName = commonService.getCodeNameByCode(localProvinceCode);
            String interProBusiness = workCoordinationService.getInterProvincialBusinessInfo(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(interProBusiness);
            mav.addObject("resultMap",resultMap);
            mav.addObject("provinceCode",localProvinceCode);
            mav.addObject("provinceName",localProvinceName);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 查看页面
     * @param priNum priNum
     * @param flag flag
     * @return ModelAndView
     */
    @RequestMapping("/azbj/ksywxt/view")
    public ModelAndView toReplyViewPage(
            @RequestParam(defaultValue = "-1", required = false) String priNum,@RequestParam String flag) {
        //上报信息
        String applyViewName = "/azbj/azbjgl/ksywxt/workCoordination_apply_view";
        //协调信息页面
        String coordinateViewName = "/azbj/azbjgl/ksywxt/workCoordination_coordinate_view";
        //原司法厅指定完司法所
        String dealOriginViewName = "/azbj/azbjgl/ksywxt/workCoordination_deal_origin_view";
        //第三司法厅同意查看页面
        String dealAgreeViewName = "/azbj/azbjgl/ksywxt/workCoordination_deal_agree_view";
        ModelAndView mav = new ModelAndView();
        try {
            String interProBusiness = workCoordinationService.getInterProvincialBusinessInfo(priNum);
            Map<String,Object> resultMap = JsonUtil.toMap(interProBusiness);
            mav.addObject("resultMap",resultMap);
            if(Constants.NumberStr.NUM_STR_ONE.equals(flag)) {
                mav.setViewName(applyViewName);
            } else if(Constants.NumberStr.NUM_STR_TWO.equals(flag)) {
                mav.setViewName(coordinateViewName);
            } else if(Constants.NumberStr.NUM_STR_THREE.equals(flag)) {
                mav.setViewName(dealOriginViewName);
            } else if(Constants.NumberStr.NUM_STR_FOUR.equals(flag)) {
                mav.setViewName(dealAgreeViewName);
            } else {
                mav.setViewName(dealAgreeViewName);
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 二次衔接上传附件页面
     * @param id id
     * @param priNum priNum
     * @param taskId taskId
     * @return ModelAndView
     */
    @GetMapping("/upload/user/uploadAppendixfileWork/view")
    public ModelAndView uploadFileToSecXj(
            @RequestParam String id,@RequestParam String priNum,@RequestParam String taskId) {
        ModelAndView modelAndView;
        try {
            UserDTO user = userService.getAuthentication();
            modelAndView = new ModelAndView("azbj/uploadappendix/upload-appendix-file-ksywxt");
            // 一批文件公用id
            modelAndView.addObject("id",id);
            // 罪犯编号
            modelAndView.addObject("priNum",priNum);
            // 任务id 1：信息补录
            modelAndView.addObject("taskId",taskId);
            modelAndView.addObject("level",user.getLevel());
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: ZcwjController -----------------------------------

    /**
     * 跳转新增页面
     * @param request request
     * @param ischeck ischeck
     * @return ModelAndView
     */
    @RequestMapping("/azbj/abzlxxgl/zcwjInfoManage/view")
    public ModelAndView toIndex13(HttpServletRequest request,
                                  @RequestParam(required = false, defaultValue = "-1") String ischeck) {
        ModelAndView modelAndView;
        try {
            if("-1".equals(ischeck)) {
                modelAndView = new ModelAndView("azbj/abzlxxgl/zcwjInfoManage_edit");
            } else {
                modelAndView = new ModelAndView("azbj/abzlxxgl/zcwjInfoManage_see");
            }
            UserDTO userDTO = userService.getAuthentication();
            modelAndView.addObject("createUser",userDTO.getAccount());
            modelAndView.addObject("govid",userDTO.getDepartName());
            modelAndView.addObject("addGovId",userDTO.getDepartid());
            modelAndView.addObject("province",userDTO.getDepartid().substring(0,2) + "0000");
            modelAndView.addObject("userlevel",userDTO.getLevel());
            //id生成器生成的uuid
            modelAndView.addObject("id",IdGen.strid());
            modelAndView.addObject("ischeck",ischeck);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: DeaprtmentController -----------------------------------

    /**
     * 跳转 部门信息
     * @return ModelAndView
     */
    @RequestMapping("/basic/department/view")
    public ModelAndView toIndex14() {
        return new ModelAndView("department/department");
    }
    // ----------------------------------- todo: LoginController -----------------------------------

    /**
     * 主页
     * @return ModelAndView
     */
    @RequestMapping("/basic/index")
    public ModelAndView toIndex15() {
        log.debug("----------------------------to index--------------------------------");
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("index");
            UserDTO userDTO = userService.getAuthentication();
            Result result = userServiceOne.selectOne(userDTO.getAccount(),Constants.NumberStr.NUM_STR_ONE);
            Map<String,Object> map;
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                map = JsonUtil.toMap(String.valueOf(result.getData()));
            } else {
                map = new HashMap<>(16);
            }
            if(null == map.get("avatar") || Constants.SpecialChar.NUM_BLANK.equals(map.get("avatar"))) {
                map.put("avatar",Avatar.getDefaultAvatar());
            }
            modelAndView.addObject("user",userDTO);
            List<HashMap<String,Object>> resultList = xttzService.getXttzList();
            if(null != resultList && !resultList.isEmpty()) {
                Object topContent = resultList.get(0).get("topContent");
                modelAndView.addObject("topContent",topContent);
            }
            modelAndView.addObject("avatar",map.get("avatar"));
            modelAndView.addObject("remind",0);
            modelAndView.addObject("taskCount",0);
            modelAndView.addObject("level",userDTO.getLevel());
            modelAndView.addObject("remoteLoginState",remoteLoginState);
            //Map<String,String> employees = selectEmployeesByDepartment();
            //是否需要强制修改密码
            modelAndView.addObject("qzChangePassword",qzChangePassword);
            //密码是否是修改过的，或者是否过期(半年未修改过期) true:修改过 false:未修改过或者过期
            boolean isChanged = true;
            String value = "";
            try {
                value = stringRedisTemplate.opsForValue().get("user:password:" + userDTO.getDepartid()
                                                                                        .substring(0,2) + ":" + userDTO.getAccount());
            } catch(RuntimeException e) {
                log.error("发生异常:{}",e.getMessage());
            }
            if(!StringUtils.isEmpty(value) && Constants.NumberStr.NUM_STR_ONE.equals(value)) {
                isChanged = false;
            }
            if(isChanged) {
                modelAndView.addObject("isChanged",0);
            }
            // 山西个性化需求:增加户籍迁入迁出小铃铛提醒
            String localCode = CodeUrlUtils.getLocalCode();
            modelAndView.addObject("localCode",localCode);
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 描述
     * @return ModelAndView
     */
    @RequestMapping("/basic/work")
    public ModelAndView toMain4() {
        ModelAndView mav;
        try {
            mav = new ModelAndView("work");
            //需要
            UserDTO userDTO = userService.getAuthentication();
            String level = userDTO.getLevel();
            mav.addObject("level",level);
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 首页
     * @return ModelAndView
     */
    @RequestMapping("/basic/main")
    public ModelAndView toMain() {
        log.debug("----------------------------to main--------------------------------");
        try {
            UserDTO userDTO = userService.getAuthentication();
            String departId = userDTO.getDepartid();
            String account = userDTO.getAccount();
            String userLevel = userDTO.getLevel();
            String level;
            Map<String, Integer> sfsjMap = new HashMap<>(16);
            //机构编码
            Map<String,String> jgCodeMap = homeStatisticalService.getJggk(account);
            if(null == jgCodeMap) {
                jgCodeMap = new HashMap<>(16);
            }
            //06-司法厅、07-司法局、08-司法局、03-司法所、09-监狱局
            if(Constants.OrgLevel.LEVEL_SFT.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_DSSFJ.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_QXSFJ.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_SFS.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_JYJ.equals(userLevel)) {
                if(Constants.OrgLevel.LEVEL_JYJ.equals(userLevel)) {
                    //监狱局
                    //todo 功能重复，需要优化
                    //核查成功
                    long hcchCount = allCensusService.jyjHcCount(departId,"3");
                    sfsjMap.put("hcchCount",Math.toIntExact(hcchCount));
                    //核查失败
                    long hcsbCount = allCensusService.jyjHcCount(departId,"4");
                    sfsjMap.put("hcsbCount",Math.toIntExact(hcsbCount));
                    //已衔接
                    long yxjCount = allCensusService.yxjCount(departId,"1");
                    sfsjMap.put("yxjCount",Math.toIntExact(yxjCount));
                    //衔接失败
                    long xjsbCount = allCensusService.yxjCount(departId,"3");
                    sfsjMap.put("xjsbCount",Math.toIntExact(xjsbCount));
                    //发起迁移
                    long fqqiCount = allCensusService.qyCount(departId,"1");
                    sfsjMap.put("fqqiCount",Math.toIntExact(fqqiCount));
                    //接收迁移
                    long jsqiCount = allCensusService.qyCount(departId,"2");
                    sfsjMap.put("jsqiCount",Math.toIntExact(jsqiCount));
                }else {
                    //安置帮教基地数量
                    Integer bjjdCount = allCensusService.bjjdCount(departId);
                    //社会组织数量
                    Integer zzCount = allCensusService.zzCount(departId);
                    //志愿者数量
                    Integer zyzCount = allCensusService.zyzCount(departId);
                    //安置帮教基地数量
                    sfsjMap.put("bjjdCount",bjjdCount);
                    //社会组织数量
                    sfsjMap.put("zzCount",zzCount);
                    //志愿者数量
                    sfsjMap.put("zyzCount",zyzCount);
                }
                // 司法厅，区县司法局，地市司法局、监狱局
                if(Constants.OrgLevel.LEVEL_SFT.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_DSSFJ.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_QXSFJ.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_JYJ.equals(userLevel)) {
                    // 司法厅
                    if(Constants.OrgLevel.LEVEL_SFT.equals(userLevel)) {
                        jgCodeMap = homeStatisticalService.getJgCode(departId);
                        if(null == jgCodeMap) {
                            jgCodeMap = new HashMap<>(16);
                        }
                        jgCodeMap.put("parentName",jgCodeMap.get("name"));
                        jgCodeMap.put("parentCode",jgCodeMap.get("code"));
                    }else {
                        // 地市司法局和区县司法局
                        jgCodeMap = homeStatisticalService.getJgxjCode(departId);
                        if(null == jgCodeMap) {
                            jgCodeMap = new HashMap<>(16);
                        }
                    }
                    //司法局（区县司法局/市司法局/省司法厅/监狱局）首页
                    ModelAndView mav = new ModelAndView("main1");
                    Set<Object> keys = stringRedisTemplate.opsForHash().keys(userDTO.getDepartid());
                    Iterator<Object> iterator = keys.iterator();
                    List<Map<String,String>> censusList = new ArrayList<>(16);
                    //如果redis中没数据，直接从数据指标统计中查询
                    if(Constants.Number.NUM_ZERO.equals(keys.size())) {
                        String bdStatisticalReports = allCensusService.getBdStatisticalReports(departId,userLevel,Constants.NumberStr.NUM_STR_FU_ONE,Constants.NumberStr.NUM_STR_FU_ONE);
                        Map<String,Object> bdMap = JsonUtil.toMap(bdStatisticalReports);
                        List<Map<String,String>> result = (List<Map<String,String>>)bdMap.get("data");
                        for(Map<String,String> map : result) {
                            if(map.get(Constants.Census.CHILDS).equals(Constants.Census.HE_JI)) {
                                continue;
                            }
                            Map<String,String> m1 = new HashMap<>(16);
                            //redis中没有，直接放入redis中
                            try {
                                stringRedisTemplate.opsForHash().put(departId,map.get(Constants.Census.CHILDS),JSON.toJSONString(map));
                            } catch(Exception e) {
                                log.error("首页存入redis数据发生异常......{}",e.getMessage());
                            }
                            if(Constants.OrgLevel.LEVEL_JYJ.equals(userLevel)) {
                                //核查总人数
                                m1.put("hczrs",map.get("hczrs_jy"));
                                //衔接总数
                                m1.put("xjzs",map.get("xjzs_jy"));
                                //完成核查总人数
                                m1.put("wchczrs",map.get("wchczrs_jy"));
                                //完成衔接数
                                m1.put("xjcgs",map.get("wcxjzs_jy"));
                                //录入人数
                                m1.put("lrrs",map.get("lrrs_jy"));
                            }else {
                                //核查总人数
                                m1.put("hczrs",map.get("hczrs"));
                                //衔接总数
                                m1.put("xjzs",map.get("xjzs"));
                                //完成核查总人数
                                m1.put("wchczrs",map.get("wchczrs"));
                                //衔接成功数
                                m1.put("xjcgs",map.get("xjcgs"));
                                //录入人数
                                m1.put("lrrs",map.get("lrrs"));
                            }
                            //机构名称
                            m1.put("jg",map.get("childs"));
                            censusList.add(m1);
                        }
                    }else {
                        while(iterator.hasNext()) {
                            Map<String,String> m1 = new HashMap<>(16);
                            Object o = iterator.next();
                            Object census = stringRedisTemplate.opsForHash().get(userDTO.getDepartid(),o);
                            Map<String, Object> map = JSON.parseObject((String)census);
                            if(map.get(Constants.Census.CHILDS).equals(Constants.Census.HE_JI)) {
                                continue;
                            }
                            if(Constants.OrgLevel.LEVEL_JYJ.equals(userLevel)) {
                                //核查总人数
                                m1.put("hczrs",(String)map.get("hczrs_jy"));
                                //衔接总数
                                m1.put("xjzs",(String)map.get("xjzs_jy"));
                                //完成核查总人数
                                m1.put("wchczrs",(String)map.get("wchczrs_jy"));
                                //完成衔接数
                                m1.put("xjcgs",(String)map.get("wcxjzs_jy"));
                                //录入人数
                                m1.put("lrrs",(String)map.get("lrrs_jy"));
                            }else {
                                //核查总人数
                                m1.put("hczrs",(String)map.get("hczrs"));
                                //衔接总数
                                m1.put("xjzs",(String)map.get("xjzs"));
                                //完成核查总人数
                                m1.put("wchczrs",(String)map.get("wchczrs"));
                                //衔接成功数
                                m1.put("xjcgs",(String)map.get("xjcgs"));
                                //录入人数
                                m1.put("lrrs",(String)map.get("lrrs"));
                            }
                            //机构名称
                            m1.put("jg",(String)map.get("childs"));
                            censusList.add(m1);
                        }
                    }
                    //根据录入人数排序
                    censusList.sort((o1,o2) -> {
                        Integer r1 = Integer.valueOf(o1.get("lrrs"));
                        Integer r2 = Integer.valueOf(o2.get("lrrs"));
                        return r2.compareTo(r1);
                    });
                    mav.addObject("sfsjMap",sfsjMap);
                    mav.addObject("jgCodeMap",jgCodeMap);
                    mav.addObject("userLevel",userLevel);
                    mav.addObject("departId",departId);
                    mav.addObject("level",userLevel);
                    mav.addObject("census",censusList);
                    mav.addObject("size",censusList.size()-5);
                    return mav;
                } else {
                    //根据departId获取表单
                    List<AzbjRsVo> azbjRsVos = allCensusService.syCount(departId);
                    //帮教对象人数
                    sfsjMap.put("bjdxrs",allCensusService.bjdxrs(departId));
                    //重点帮教对象人数
                    sfsjMap.put("zdbjdxrs",allCensusService.zdbjdxrs(departId));
                    sfsjMap.put("azbjjd",allCensusService.azbjjd(departId));
                    sfsjMap.put("shzz",allCensusService.shzz(departId));
                    sfsjMap.put("zyzrs",allCensusService.zyzrs(departId));
                    if(azbjRsVos != null) {
                        for(AzbjRsVo azbjRsVo : azbjRsVos) {
                            //未衔接人数
                            if("wxjrs".equals(azbjRsVo.getField())) {
                                sfsjMap.put("wxjrs",azbjRsVo.getCount());
                            }
                            //失联人数
                            if("slrs".equals(azbjRsVo.getField())) {
                                sfsjMap.put("slrs",azbjRsVo.getCount());
                            }
                        }
                    }
                    //司法所首页
                    ModelAndView mav = new ModelAndView("main2");
                    mav.addObject("sfsjMap",sfsjMap);
                    mav.addObject("localCode",CodeUrlUtils.getLocalCode());
                    return mav;
                }
            /*1	中华人民共和国司法部
            10	中华人民共和国司法部法治局
            2	中华人民共和国司法部监狱局
            3	中华人民共和国公安部*/
                //01-未成年犯管教所、09-监狱管理局、02-看守所、05-社矫中心、11-地市社矫机构、4-公安厅监管总队、13-公安局监管支队、14-区县社矫机构、15-省社矫管理局
            }
            else if(Constants.OrgLevel.LEVEL_JY.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_KSS.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_JGZONGD.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_SJZX.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_JGZD.equals(userLevel)) {
                //省社矫管理局、地市社矫机构、区县社矫机构、公安厅监管总队、公安局监管支队、level为1
                if(Constants.OrgLevel.LEVEL_DSSJ.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_JGZONGD.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_JGZD.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_QXSJ.equals(userLevel)
                        || Constants.OrgLevel.LEVEL_SSJ.equals(userLevel)) {
                    level = Constants.NumberStr.NUM_STR_ONE;
                } else {
                    //未成年犯管教所、监狱、看守所、社矫中心、level为2
                    level = Constants.NumberStr.NUM_STR_TWO;
                }
                //根据departId获取表单、从缓存表中获得数据
                List<AzbjRsVo> azbjRsVos = allCensusService.syCount(departId);
                if(azbjRsVos != null) {
                    for(AzbjRsVo azbjRsVo : azbjRsVos) {
                        //待核查人数
                        if("dhcrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("dhcrs",azbjRsVo.getCount());
                        }
                        //核查失败人数
                        if("hcsbrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("hcsbrs",azbjRsVo.getCount());
                        }
                        //未进行出监、危险性评估人数
                        if("wpgrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("wpgrs",azbjRsVo.getCount());
                        }
                        //待衔接人数
                        if("dxjrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("dxjrs",azbjRsVo.getCount());
                        }
                        //带衔接重点对象人数
                        if("dxjzddxrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("dxjzddxrs",azbjRsVo.getCount());
                        }
                        //未衔接人数
                        if("wxjrs".equals(azbjRsVo.getField())) {
                            sfsjMap.put("wxjrs",azbjRsVo.getCount());
                        }
                    }
                }
                //返回监所首页
                ModelAndView mav = new ModelAndView("main3");
                mav.addObject("sfsjMap",sfsjMap);
                return mav;
            } else if(Constants.OrgLevel.LEVEL_DSSJ.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_QXSJ.equals(userLevel)
                    || Constants.OrgLevel.LEVEL_SSJ.equals(userLevel)) {
                level = Constants.NumberStr.NUM_STR_ONE;
                sfsjMap.put("sjhccgrs",allCensusService.sjhccgrs(departId).getCount());
                sfsjMap.put("sjhcsbrs",allCensusService.sjhcsbrs(departId).getCount());
                sfsjMap.put("sjxjzrs",allCensusService.sjxjzrs(departId).getCount());
                sfsjMap.put("sjxjcgrs",allCensusService.sjxjcgrs(departId).getCount());
                sfsjMap.put("sjxjsbrs",allCensusService.sjxjsbrs(departId).getCount());
                sfsjMap.put("sjwxjrs",allCensusService.sjwxjrs(departId).getCount());
                //返回社矫首页
                ModelAndView mav = new ModelAndView("main4");
                mav.addObject("sfsjMap",sfsjMap);
                return mav;
            }
            return new ModelAndView("main");
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            ModelAndView modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
    // ----------------------------------- todo: MenuController -----------------------------------

    /**
     * 通用LIST页面
     * @param id 资源id
     * @param state state
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/basic/public-list/view")
    public ModelAndView toPublicList(HttpServletRequest request,@RequestParam Long id,@RequestParam(required = false) String state) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("menu/public-list");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                if(request.getQueryString().indexOf("&zdbjdx")!=-1){
                    ArrayList<Map<String,Object>> list = (ArrayList<Map<String,Object>>)data.get("rightList");
                    Map<String,Object> mapList = list.get(1);
                    mapList.put("extension", mapList.get("extension")+" value='01'");
                }
                modelAndView.addAllObjects(data);
                rightFix(data,1575,1.2);

            }
            modelAndView.addObject("showCheckColumn","false");
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 根据资源右边搜索条件宽度是否大于前端搜索行调整单元格的大小,是否换行。
     * @param data 资源数据
     * @param lengthTd 条件行总长度
     * @param percentage 百分比例
     * @return false 代表不换行，true 代表换行
     */
    private boolean rightFix(Map<String,Object> data,int lengthTd,double percentage) {
        List<Map<String,Object>> left=new ArrayList<>(11);
        if(ObjectUtils.isNotEmpty(data.get("rightList"))){
            left=(List<Map<String,Object>>)data.get("rightList");
        }
        //计算搜索条件的长度，按照是否大于1500
        int length=0;
        for(int i = 0; i <left.size() ; i++) {
            int a =(int)left.get(i).get("width");
            length+=a;
        }
        if(length < lengthTd){
            for(int i = 0; i <left.size() ; i++) {
                Integer width = (Integer)left.get(i).get("width");
                BigDecimal bd = new BigDecimal(width);
                bd = bd.multiply(new BigDecimal(percentage));
                left.get(i).put("width",bd.intValue());
            }
            data.put("rightList",left);
            return false;
        }
        return true;
    }

    /**
     * 通用LIST页面
     * @param id id
     * @param state state
     * @return ModelAndView
     */
    @RequestMapping("/basic/public-list/view/showCheckColumn")
    public ModelAndView toPublicListShowCheckColumn(
            @RequestParam Long id,@RequestParam(required = false) String state) throws JsonProcessingException {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("menu/public-list");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectListPageComponent(userDTO.getAccount(),id,state,userDTO.getLevel());
            Map<String,Object> self= new HashMap<>(16);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> data = (Map<String,Object>)result.getData();
                if(ObjectUtils.isNotEmpty(data.get("self"))){
                   self=(Map<String,Object>)data.get("self");
                }
                data.put("state",state);
                //如果不是工作台---全部-的话，去掉服刑人员状态查询搜索框----------------by pzc--------start
                if(!"0".equals(state)) {
                    ArrayList<Map<String,Object>> rightList = (ArrayList<Map<String,Object>>)data.get("rightList");
                    for(Map<String,Object> map : rightList) {
                        if("服刑人员状态".equals(map.get("name"))) {
                            rightList.remove(map);
                            break;
                        }
                    }
                }
                //如果不是工作台---全部-的话，去掉服刑人员状态查询搜索框----------------by pzc--------end
                modelAndView.addAllObjects(data);
                if(userDTO.getLevel().equals(Constants.OrgLevel.LEVEL_SFT) && Constants.ResourceId.BATCH_IMPORT_DHCRY.equals(self.get("id").toString())){
                    modelAndView.addObject("showCheckColumn","false");
                }else{
                    modelAndView.addObject("showCheckColumn","true");
                }
                modelAndView.addObject("state",state);
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }

    /**
     * 通用TAB页面
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/basic/public-tab/view")
    public ModelAndView toPublicTab(@RequestParam Long id) {
        ModelAndView modelAndView = new ModelAndView();
        try {
            modelAndView.setViewName("menu/public-tab");
            UserDTO userDTO = userService.getAuthentication();
            Result result = menuservice.selectTabPageComponent(userDTO.getAccount(),id);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                modelAndView.addObject("tabList",result.getData());
            }
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView.setViewName("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
        }
        return modelAndView;
    }
    // ----------------------------------- todo: PositionController -----------------------------------

    /**
     * 跳转 岗位列表
     * @return ModelAndView
     */
    @RequestMapping("/basic/position/position_list/view")
    public ModelAndView toIndex16() {
        return new ModelAndView("position/position_list");
    }

    /**
     * 跳转 编辑页面
     * @param flag flag
     * @return ModelAndView
     */
    @RequestMapping("/basic/position/edit")
    public ModelAndView toPositionEdit(@RequestParam String flag) {
        ModelAndView modelAndView = new ModelAndView("position/position_edit");
        modelAndView.addObject("flag",flag);
        return modelAndView;
    }
    // ----------------------------------- todo: ResourceController -----------------------------------

    /**
     * 跳转 资源管理
     * @return ModelAndView
     */
    @RequestMapping("/basic/resource/view")
    public ModelAndView toResource() {
        return new ModelAndView("resource/resource");
    }
    // ----------------------------------- todo: RoleController -----------------------------------

    /**
     * 跳转 角色列表
     * @return ModelAndView
     */
    @RequestMapping("/basic/role/role_list/view")
    public ModelAndView toRoleList() {
        return new ModelAndView("role/role_list");
    }

    /**
     * 跳转 角色编辑
     * @param flag flag
     * @return ModelAndView
     */
    @RequestMapping("/basic/role/edit/view")
    public ModelAndView toRoleEdit(@RequestParam String flag) {
        ModelAndView modelAndView = new ModelAndView("role/role_edit");
        modelAndView.addObject("flag",flag);
        return modelAndView;
    }
    // ----------------------------------- todo: RoleResController -----------------------------------

    /**
     * 跳转 权限分配页面
     * @return ModelAndView
     */
    @RequestMapping("/basic/role/roleres/view")
    public ModelAndView toRoleres() {
        return new ModelAndView("role/role_res");
    }
    // ----------------------------------- todo: UserController -----------------------------------

    /**
     * 跳转到用户列表
     * @return ModelAndView
     */
    @RequestMapping("/basic/user/user_list/view")
    public ModelAndView toUserList() {
        return new ModelAndView("user/user_list").addObject("mima",mima);
    }

    /**
     * 跳转到用户编辑
     * @param flag flag
     * @return ModelAndView
     */
    @RequestMapping("/basic/user/edit")
    public ModelAndView toUserEdit(@RequestParam String flag) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("user/user_edit");
            modelAndView.addObject("flag",flag);
            //-------- 新增单点登录手机号码必填功能-----by 潘志成------- 2022-06-21---开始
            if(Constants.StrFinalValue.TRUEVALUE.equals(ssoConfig.getEnabled())) {
                //说明开启单点登录
                modelAndView.addObject("sso",true);
            } else {
                modelAndView.addObject("sso",false);
            }
            //-------- 新增单点登录手机号码必填功能-----by 潘志成------- 2022-06-21---结束
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 首页用户信息
     * @return ModelAndView
     */
    @RequestMapping("/basic/user/user-info/view")
    public ModelAndView selectUserInfo() {
        ModelAndView modelAndView;
        try {
            UserDTO userDTO = userService.getAuthentication();
            String localCode = CodeUrlUtils.getLocalCode();
            if(Constants.XzqhCode.SHAN1XI.equals(localCode)) {
                modelAndView = new ModelAndView("user/user_info_sx");
                String account = userDTO.getAccount();
                Result result = userServiceOne.selectUserPositionInfo(account);
                Map<String,Object> map = JsonUtil.toMap(String.valueOf(result.getData()));
                modelAndView.addObject("postcode",map.get("postCode"));
                modelAndView.addObject("positionPro",map.get("positionPro"));
                modelAndView.addObject("positionCity",map.get("positionCity"));
                modelAndView.addObject("positionCou",map.get("positionCou"));
                modelAndView.addObject("positionVill",map.get("positionVill"));
                modelAndView.addObject("positionProName",map.get("positionProName"));
                modelAndView.addObject("positionCityName",map.get("positionCityName"));
                modelAndView.addObject("positionCouName",map.get("positionCouName"));
                modelAndView.addObject("positionVillName",map.get("positionVillName"));
            } else{
                modelAndView = new ModelAndView("user/user_info");
            }
            String account = userDTO.getAccount();
            Result result = userServiceOne.selectOne(account,Constants.NumberStr.NUM_STR_ONE);
            Map<String,Object> map;
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                map = JsonUtil.toMap(String.valueOf(result.getData()));
            } else {
                map = new HashMap<>(16);
            }
            //-------- 新增单点登录手机号码必填功能-----by 潘志成------- 2022-06-21---开始
            if("true".equals(ssoConfig.getEnabled())) {
                //说明开启单点登录
                modelAndView.addObject("sso",true);
            } else {
                modelAndView.addObject("sso",false);
            }
            //-------- 新增单点登录手机号码必填功能-----by 潘志成------- 2022-06-21---结束
            modelAndView.addObject("account",userDTO.getAccount());
            modelAndView.addObject("username",userDTO.getUsername());
            modelAndView.addObject("departname",map.get("departName"));
            modelAndView.addObject("positionname",map.get("positionName"));
            modelAndView.addObject("phone",map.get("phone"));
            modelAndView.addObject("email",map.get("email"));
            boolean flag = (null != map.get(Constants.StrFinalValue.AVATAR) && StringUtils.isBlank(map.get(Constants.StrFinalValue.AVATAR)
                                                                                                      .toString())) || null == map.get(Constants.StrFinalValue.AVATAR);
            if(flag) {
                String avatar = Avatar.getDefaultAvatar();
                modelAndView.addObject(Constants.StrFinalValue.AVATAR,avatar);
            } else {
                modelAndView.addObject(Constants.StrFinalValue.AVATAR,map.get("avatar"));
            }
            modelAndView.addObject("telphone",map.get("telphone"));
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * 跳转 修改密码页面
     * @return ModelAndView
     */
    @GetMapping("/basic/user/user-changepwd/view")
    public ModelAndView changePwd() {
        return new ModelAndView("user/user_changepwd");
    }

    /**
     * 跳转 第一次修改密码页面
     * @return ModelAndView
     */
    @GetMapping("/basic/user/user-first-changepwd/view")
    public ModelAndView firstChangePwd() {
        return new ModelAndView("user/user_first_changepwd");
    }

    /**
     * 跳转 上传头像
     * @param account account
     * @return ModelAndView
     */
    @GetMapping("/basic/user/user-head/view")
    public ModelAndView userHead(String account) {
        ModelAndView modelAndView = new ModelAndView("user/user_updateHead");
        modelAndView.addObject("account",account);
        return modelAndView;
    }

    /**
     * 司法所人员信息补录-解教补录--危险性评估tab页面
     * 注意：
     * @param request request
     * @param prinum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/xxblBl/wxxpg/tab")
    public ModelAndView toSqzjWxxpgBlTab(HttpServletRequest request,@RequestParam(required = false) String prinum) {
        ModelAndView mav;
        try {
            String localCode = CodeUrlUtils.getLocalCode();
            mav = new ModelAndView("/azbj/sqjz/sqjz_wxxpg_tab");
            if(StringUtils.isEmpty(prinum)) {
                // 查询改造表现附件数量
                Result result = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FOUR);
                // 查询心理健康附件数量
                Result result1 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FIVE);
                Result result3 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_ONE);
                mav.addObject("count",result.getData());
                mav.addObject("count1",result1.getData());
                mav.addObject("count3",result3.getData());
                return mav;
            }
            // 查询改造表现附件数量
            Result result = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FOUR);
            // 查询心理健康附件数量
            Result result1 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_FIVE);
            Result result3 = uploadAppendixService.getCountAll(prinum,Constants.NumberStr.NUM_STR_ONE);
            mav.addObject("count",result.getData());
            mav.addObject("count1",result1.getData());
            mav.addObject("count3",result3.getData());
            //查询该罪犯出监评估信息
            String cjpgInfo = xxblService.selectCjpgInfoByPrNum(prinum);
            Map<String,Object> cjpgInfoMap = JsonUtil.toMap(cjpgInfo);
            //危险性评估信息
            String map = sentenceService.getSenInfoById(prinum);
            if(Constants.NumberStr.NUM_STR_FU_ONE.equals(map)) {
                mav.addObject("priNum",prinum);
                //表示该罪犯未保存服刑信息
                mav.addObject("fxFlag",Constants.NumberStr.NUM_STR_ZERO);
                return mav;
            }
            Map<String,Object> jsonMap = JsonUtil.toMap(map);
            mav.addObject("priNum",prinum);
            mav.addObject("id",ObjectUtils.isEmpty(jsonMap.get("id")) ? null : jsonMap.get("id"));
            mav.addObject("amnesty","".equals(jsonMap.get("amnesty")) ? null : jsonMap.get("amnesty"));
            mav.addObject("zfz","".equals(jsonMap.get("zfz")) ? null : jsonMap.get("zfz"));
            mav.addObject("death","".equals(jsonMap.get("death")) ? null : jsonMap.get("death"));
            mav.addObject("zrsqjz","".equals(jsonMap.get("zrsqjz")) ? null : jsonMap.get("zrsqjz"));
            mav.addObject("sanwu",jsonMap.get("sanwu"));
            mav.addObject("sanjia",jsonMap.get("sanjia"));
            mav.addObject("wujia",jsonMap.get("wujia"));
            mav.addObject("wuqin",jsonMap.get("wuqin"));
            mav.addObject("wuye",jsonMap.get("wuye"));
            mav.addObject("jxm",jsonMap.get("jxm"));
            mav.addObject("jsf",jsonMap.get("jsf"));
            mav.addObject("jhj",jsonMap.get("jhj"));
            mav.addObject("wushe",jsonMap.get("wushe"));
            mav.addObject("sishi",jsonMap.get("sishi"));
            mav.addObject("shekong",jsonMap.get("shekong"));
            mav.addObject("shexie",jsonMap.get("shexie"));
            mav.addObject("shedu",jsonMap.get("shedu"));
            mav.addObject("sheqiang",jsonMap.get("sheqiang"));
            mav.addObject("shehei",jsonMap.get("shehei"));
            mav.addObject("xijing",jsonMap.get("xijing"));
            mav.addObject("taotuo",jsonMap.get("taotuo"));
            mav.addObject("drughis",jsonMap.get("drughis"));
            mav.addObject("zisha",jsonMap.get("zisha"));
            mav.addObject("gaizao",jsonMap.get("gaizao"));
            mav.addObject("renzui",jsonMap.get("renzui"));
            mav.addObject("xinli",jsonMap.get("xinli"));
            mav.addObject("lianxi",jsonMap.get("lianxi"));
            mav.addObject("baowaijiuyi","".equals(jsonMap.get("baowaijiuyi")) ? null : jsonMap.get("baowaijiuyi"));
            mav.addObject("pinggu",jsonMap.get("pinggu"));
            mav.addObject("weifa",jsonMap.get("weifa"));
            mav.addObject("canji",jsonMap.get("canji"));
            mav.addObject("Aftype",jsonMap.get("Aftype"));
            mav.addObject("localCode",localCode);
            if(null != cjpgInfoMap) {
                mav.addObject("canji",cjpgInfoMap.get("canji"));
                mav.addObject("xd",cjpgInfoMap.get("xd"));
                mav.addObject("gdzs",cjpgInfoMap.get("gdzs"));
                mav.addObject("shjw",cjpgInfoMap.get("shjw"));
                mav.addObject("jtbh",cjpgInfoMap.get("jtbh"));
                mav.addObject("baowaijiuyi",cjpgInfoMap.get("baowaijiuyi"));
                mav.addObject("xshkn",cjpgInfoMap.get("xshkn"));
                mav.addObject("jiuzhujianyi",cjpgInfoMap.get("jiuzhujianyi"));
            }
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 预安置管理 - 预安置人员迁移 - 发起迁移 - 添加页面
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/transfer/view/addhjqyTab")
    public ModelAndView toQyInfoTab(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/yazgl/hjqy/addhjqyTab");
            UserDTO authentication = userService.getAuthentication();
            String level = authentication.getLevel();
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                Result result = prisonerTransferService.getTransferById(id);
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
                mv.addObject("adduserid",authentication.getDepartid());
                mv.addObject("level",level);
                return mv;
            } else {
                id = idGenService.getId();
            }
            if(Objects.equals(Constants.OrgLevel.LEVEL_QXSFJ,level)) {
                mv.addObject("taskType",Constants.NumberStr.NUM_STR_TWO);
            } else if(StrUtil.containsEquals(level,Constants.OrgLevel.LEVEL_JY,Constants.OrgLevel.LEVEL_KSS,Constants.OrgLevel.LEVEL_SJZX)) {
                mv.addObject("taskType",Constants.NumberStr.NUM_STR_ONE);
            }
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            Date date = new Date();
            String format = simpleDateFormat.format(date);
            mv.addObject("moveOutTime",format);
            mv.addObject("id",id);
            mv.addObject("adduserid",authentication.getDepartid());
            mv.addObject("qclxr",authentication.getUsername());
            mv.addObject("qclxdh",authentication.getPhone());
            mv.addObject("qclxgh",authentication.getTelphone());
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 预安置管理 - 预安置人员迁移 - 接收迁移 - 确认迁移页面
     * @param id id
     * @return ModelAndView
     */
    @RequestMapping("/azbj/transfer/view/toConfirmMigration")
    public ModelAndView toConfirmMigration(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/yazgl/hjqy/toConfirmMigration");
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                Result result = prisonerTransferService.getTransferById(id);
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
                UserDTO authentication = userService.getAuthentication();
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                Date date = new Date();
                String format = simpleDateFormat.format(date);
                mv.addObject("moveOutTime",format);
                mv.addObject("id",id);
                mv.addObject("qrlxr",authentication.getUsername());
                mv.addObject("qrlxdh",authentication.getPhone());
                mv.addObject("qrlxgh",authentication.getTelphone());
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 预安置管理 - 预安置人员迁移 - 发起迁移 - 查看失败原因
     * @param id transfet编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/transfer/fqqy/toFailureReason")
    public ModelAndView toFailureReason(@RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/yazgl/hjqy/hjqy_view");
            if(!StringUtils.equals(id,Constants.NumberStr.NUM_STR_FU_ONE)) {
                Result result = prisonerTransferService.getTransferById(id);
                Map<String,Object> data = (Map<String,Object>)result.getData();
                mv.addAllObjects(data);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 预安置管理 - 预安置人员迁移 - 查看
     * @param priNum 服刑人员编号
     * @param id 迁移编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/baseInfo/hjqc/toTransferViewTabs/view")
    public ModelAndView toTransferViewTabs(
            @RequestParam(required = false, defaultValue = "-1") String priNum,
            @RequestParam(required = false, defaultValue = "-1") String id) {
        ModelAndView mv = new ModelAndView("/azbj/yazgl/hjqy/yazTransferViewTabs");
        mv.addObject("priNum",priNum);
        mv.addObject("id",id);
        return mv;
    }

    /**
     * 预安置管理 - 预安置人员迁移 - 查看 - 数据迁移
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqc/toViewTabs/view/qyInfoTab")
    public ModelAndView toTransferInfoTab(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv;
        try {
            mv = new ModelAndView("/azbj/yazgl/hjqy/transferViewInfo");
            //这个priNum既充当文件附件表中的id，又充当上传附件后发起流转的迁移表中的id
            mv.addObject("priNum",priNum);
            Result result = prisonerTransferService.getTransferById(priNum);
            if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                Map<String,Object> map = (Map<String,Object>)result.getData();
                mv.addAllObjects(map);
            }
            return mv;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mv = new ModelAndView("/error/system_error");
            mv.addObject("error",e.getMessage());
            return mv;
        }
    }

    /**
     * 解矫信息补录按钮 - 补录公共页面
     * @return ModelAndView
     */
    @RequestMapping("/sqjz/topopup_bl")
    public ModelAndView toPopupbl() {
        return new ModelAndView("/azbj/sqjz/sqjz_blbaseinfo_popup");
    }

    /**
     * 基础信息--服刑信息补录
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/bl_inmates/termedit/view")
    public ModelAndView toSentenceBl(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_blinmates_sentence");
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 基础信息--社会关系信息增加
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/social-relations/view")
    public ModelAndView toIndex(@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_social_relations");
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 基础信息--附件信息添加
     * @param id id
     * @param priNum 服刑人员编号
     * @return ModelAndView
     */
    @RequestMapping("/azbj/sqjz/attachment-relations/view")
    public ModelAndView toSqjzAttachment(@RequestParam("id") String id,@RequestParam("priNum") String priNum) {
        ModelAndView mav;
        try {
            mav = new ModelAndView("azbj/sqjz/sqjz_attachment");
            mav.addObject("id",id);
            mav.addObject("priNum",JsonUtil.toText(priNum));
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 上传文件
     * @param req req
     * @param file file
     * @return ModelAndView
     */
    @PostMapping(value = "/upload", produces = "text/html;charset=utf-8")
    public ModelAndView upload(HttpServletRequest req,@RequestParam("file") MultipartFile file) {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("user/upload-result");
            if(file.isEmpty()) {
                modelAndView.addObject("msg","上传文件为空");
                return modelAndView;
            }
            String account = req.getParameter("account");
            try {
                BASE64Encoder encoder = new BASE64Encoder();
                // 通过base64来转化图片
                String basefile = encoder.encode(file.getBytes());
                Result result = userServiceOne.updateUserHead(account,basefile);
                if(Constants.Number.NUM_ONE.equals(result.getCode())) {
                    modelAndView.addObject("msg",result.getData());
                }
            } catch(Exception e) {
                log.error("发生异常:{}",e.getMessage());
                modelAndView.addObject("msg","文件上传失败");
            }
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }

    /**
     * sfbadmin--系统管理--统计
     * @return ModelAndView
     */
    @RequestMapping("/xtgl/census")
    public ModelAndView censusAll() {
        ModelAndView mav;
        try {
            mav = new ModelAndView("resource/censusAll");
            return mav;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            mav = new ModelAndView("/error/system_error");
            mav.addObject("error",e.getMessage());
            return mav;
        }
    }

    /**
     * 跳转服刑信息变更页面
     * @param request request
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/fxbg")
    public ModelAndView fxbgTabs(HttpServletRequest request) {
        Map<String,Object> params = ConvertHttpToMap.getParameterMap(request);
        String priNum = (String)params.get("priNum");
        //上一次的刑期止日
        String pristopold2 = (String)params.get("pristopold");
        ModelAndView modelAndView = new ModelAndView("/azbj/yazgl/xxbg-tabs");
        modelAndView.addObject("priNum",priNum);
        //将上一次的刑期止日放入到页面中回显
        modelAndView.addObject("pristopold",pristopold2);
        return modelAndView;
    }

    /**
     * 预安置管理 - 预释放人员 - 信息补录 - 服刑信息变更
     * @param request request
     * @param priNum prinum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/yazgl/xxbl/jbxx/tab")
    public ModelAndView toJbxxTab(HttpServletRequest request ,@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mav = new ModelAndView("/azbj/yazgl/jbxx-tab");
        //查询该罪犯出监评估信息
        //危险性评估信息
        String map = sentenceService.getSenInfoById(priNum);
        Map<String,Object> jsonMap = JsonUtil.toMap(map);
        mav.addObject("priNum",priNum);
        mav.addObject("id",jsonMap.get("id")==""?null:jsonMap.get("id"));
        mav.addObject("amnesty","".equals(jsonMap.get("amnesty"))?null:jsonMap.get("amnesty"));
        mav.addObject("zfz","".equals(jsonMap.get("zfz"))?null:jsonMap.get("zfz"));
        mav.addObject("death","".equals(jsonMap.get("death"))?null:jsonMap.get("death"));
        mav.addObject("zrsqjz","".equals(jsonMap.get("zrsqjz"))?null:jsonMap.get("zrsqjz"));
        mav.addObject("deathTime","".equals(jsonMap.get("deathTime"))?null:jsonMap.get("deathTime"));
        mav.addObject("baseRemark","".equals(jsonMap.get("baseRemark"))?null:jsonMap.get("baseRemark"));
        //判断这条数据是不是社矫录入
        String role = userService.getAuthentication().getRoleid();
        mav.addObject("role",role);
        return mav;
    }

    /**
     * 山西个性化需求:安置帮教管理 - 帮教对象信息管理 - 户籍迁出人员管理 - 接收
     * @param priNum priNum
     * @return ModelAndView
     */
    @RequestMapping("/azbj/bjdxInfo/hjqr/toAccept/view")
    public ModelAndView toAccept(@RequestParam(required = false, defaultValue = "-1") String priNum) {
        ModelAndView mv = new ModelAndView("/azbj/azbjgl/bjdxInfo/hjqrjs");
        mv.addObject("priNum", priNum);
        Result result = bjdxMvInfoService.getMvBaseInfoByPriNum(priNum);
        if(Constants.Number.NUM_ONE.equals(result.getCode())) {
            Map<String,Object> map = (Map<String,Object>)result.getData();
            mv.addAllObjects(map);
        }
        return mv;
    }
    /**
     * 跳转 登录统计
     * @return ModelAndView
     */
    @RequestMapping("/loginCensus/view")
    public ModelAndView toLoginCensus() {
        ModelAndView modelAndView;
        try {
            modelAndView = new ModelAndView("loginCensus");
            return modelAndView;
        } catch(Exception e) {
            log.error("发生异常:{}",e.getMessage());
            modelAndView = new ModelAndView("/error/system_error");
            modelAndView.addObject("error",e.getMessage());
            return modelAndView;
        }
    }
}